Skip to Content

Quick Guide for Overcoming Oracle Stored Procedure Limitation in Tableau

Blog | August 11, 2023 | By Shaswath Thunga Devaraj URS, Deepak Bhambhani

Tableau is a leading data visualization and business intelligence software that helps you connect, visualize, and share data in an engaging and interactive way. Whether you are an analyst, a data scientist, a business professional, or an organization, you can use Tableau to gain insights from your data and make data-driven decisions.

Oracle is a powerful and widely used relational database management system that supports PL/SQL, a procedural extension of SQL. PL/SQL allows you to create stored procedures, which are named blocks of code that are stored in the database and can be executed on-demand by applications or users. Stored procedures are useful for encapsulating business logic and repetitive tasks, providing a modular approach to application development, and improving the performance and security of the database.

However, if you want to use Tableau to visualize data from an Oracle stored procedure, you might encounter a peculiar problem. Tableau does not show Oracle stored procedures in the data source pane when connected to an Oracle database. This means that you cannot build reports that fetch data from stored procedures.

But don’t worry, there is an easy workaround for this. You can convert your stored procedure into a function with the same logic and use it in Tableau instead. A function is similar to a stored procedure, but it returns a value or a result set. Tableau can recognize and use Oracle functions to create the report.

In this blog post, we will show you how you can convert an Oracle stored procedure into a function and use it in Tableau to create a report. Follow these steps to get started.

Step 1:

Create an object.


     (COL1       VARCHAR2(50),

      COL2       VARCHAR2(50),

      COL3       VARCHAR2(50));

Step 2:

Create Table using object.


Step 3:

Create a function.

create or replace function myfunction2 (p_pxobjclass in varchar2)

return my_obj_table pipelined



for r_curl in (select cust_cd,cust_nm,tax_cd from BIWMARTS.CUSTOMER_DIM where rownum<100)


    pipe row (my_object(r_curl.cust_cd,r_curl.cust_nm,r_curl.tax_cd));          

  end loop;



Step 4:

Call the function in Tableau using custom SQL. Below is an example for reference.

select COL1, COL2, COL3 from TABLE (myfunction2('SomeSampletask'))

‘SomeSampletask’ is a dummy parametric value

And there you have it! Thank us later.

author image
About the Author
Shaswath is a highly-skilled software engineer with proficiency in Alteryx, Oracle, Snowflake, Teradata, and Tableau. His experience encompasses the information technology and services sector, where he applies his expertise in data transformation, analytics, and visualization to provide valuable insights for clients.
Shaswath Thunga Devaraj URSTechnical Lead - Visual Analytics | USEReady
author image
About the Author
As Solution Principal at USEReady, Deepak brings a wealth of experience in Business Intelligence, Information Management, and Analytics, complemented by his robust project management and leadership capabilities. Deepak excels in leveraging technology to enhance business processes and drive value.
Deepak BhambhaniSolution Principal - Visual Analytics | USEReady
Back to top