Posts

Showing posts with the label oracle

Tableau: Convert Oracle Spatial Data into Tableau Format

Click here for other Tableau related Blogs I had requirement to shapes we had in Oracle Spatial data( which we used for MapInfo) in Tableau. Since tableau doesnt support Oracle spatial type columns, I had to extract that data in Tableau readable format. Here are the steps to convert oracle spatial data into format useable by Tableau. Run the Oracle package ven_OraSpatial_2_TabData in your oracle environment. Now run the below "ConvertDataFormat" code to extract the data into Tableau format Now use extracted data in tableau ( refer to my blog -  Tableau Maps - Custom shapes / polygon - Basics ) You can also download the code from this link -   VEN_ORASPATIAL_2_TABDATA.zip Oracle package ven_OraSpatial_2_TabData SPEC CREATE OR REPLACE PACKAGE VSUBR.ven_OraSpatial_2_TabData as ----- TYPE TYPE rec_LatLong IS RECORD( Polygon_ID NUMBER, LAT NUMBER, LON NUMBER ); TYPE tab...

Ora | dba_source - Extended

Image
dba_source - Extended This utility extends the default DBA_SOURCE view and gives the below additional details as separate columns. TEXT column for uncommented code name of the procedure, function and cursor name defined within a package/procedure/function. sub procedure / function name i.e procedures and functions defined within a another procedure/function. Download the Source Code TYPE  - typ_uc_dba_source_rec.sql TYPE - typ_uc_dba_source_tab.sql FUNCTION - uc_dba_source_fun.sql VIEW - uc_dba_source_v.sql Installation Steps Download the sqls from the above links. Run them in the same order. Usage Notes select * from uc_dba_source_v where owner = '[schema name]' and object_name = '[procedure/function/package name]' Example Here is the source code of the package body, taken for our example CREATE OR REPLACE PACKAGE BODY VSUBR.my_test IS /* this package is the test package to show how the DBA_source -extention wor...

Ora | HTML eMail Util

HTML eMail Utility This Package/function is useful for sending emails from your pl/sql Code. It send out emails with simple HMTL tags, which can used for neatly formatting your emails.  Download the Source Code Package_spec - PKG_HTML_eMAIL_spec.sql Package_body -PKG_HTML_eMAIL_body.sql Installation Steps Download the package spec and the body from the above links. Run the downloaded script and ensure you have a valid PKG_HTML_eMAIL package. Usage Notes **************************** * Example-1 : Simple Email **************************** DECLARE a NUMBER; BEGIN a := PKG_HTML_eMAIL.sendSimpleEmail('test@domain.com', 'testing', ' Testing HTML body R1 - C1 R1 - C2 R1 - C3 R2 - C1 R2 - C2 R2 - C3 '); IF...

Ora | getNext

Get_Next This function is useful for extracting the values from a comma separated values. Parameters   pv_in_string      is the delmited string      pn_in_pos     position of the value that is required      pv_in_delimiter      single delimiter char      pv_in_endofstr      If this string is set to 'Y' then it will return a string like $$END$$ when the    requested position(pn_in_no) is greater than the maximum position available    within that string. i.e if the position is beyond the end of the string. This might    be useful to decide when to EXIT when the we are writing a LOOP logic on a    comma delimted string. Normally we exit when we get a NULL value for a    position.  Function create or replace CREATE OR REPLACE FUNCTION VSUBR.getNext( pv_in_string IN VARCHAR2, ...