Re: Need help for using package 'dbms_sql'

From: Wayne Linton <lintonw_at_cadvision.com>
Date: 1996/12/08
Message-ID: <32ABA20B.5581_at_cadvision.com>#1/1


Dynamic SQL via the DBMS_SQL package executes a character string that is a valid SQL statement - you can create that string however you wish. Passing it to the procedure as a parameter is just fine.

ORACLE magazine has an article on the DBMS_SQL package (March/April 1995). If you don't have it, look it up on ORACLE Magazine in the ARCHIVE section. I used this to get started and have successfully created SQL statements via multiple string concatenations and then passing them to DBMS_SQL for execution.

And of course there are the ORACLE manuals. Chapter 7 of the ORACLE7 Server Documentation Addendum for ORACLE7 V7.1 is where I look.

Have fun! The hardest part of it is ensuring that the SQL string you have constructed is correct. Maybe use DBMS_OUTPUT to print the string beforehand while you debug.

Wayne Linton
Shell Canada Ltd. Received on Sun Dec 08 1996 - 00:00:00 CET

Original text of this message