Skip to Main Content
  • Questions
  • How to print dynamic SQL where SELECT, FROM and WHERE is dynamic


Question and Answer

Tom Kyte

Thanks for the question.

Asked: March 12, 2001 - 7:09 am UTC

Last updated: March 13, 2001 - 1:35 pm UTC

Version: 7.3.4

Viewed 1000+ times

You Asked

I want to write a procedure which executes my dynamic query. I want to call this procedure to execute different queries and print the results (Columns)

and we said...


it shows how to dynamically create a flat file from any query using DBMS_SQL.  Change the UTL_FILE calls to dbms_output and you have what you need.

See also: <code>

which is another example of the above which uses dbms_output. It prints query results down the page instead of across.


  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment


A reader, March 13, 2001 - 1:35 pm UTC

More to Explore


More on PL/SQL routine DBMS_SQL here