x

Can one use dynamic SQL within PL/SQL?

Can one use dynamic SQL within PL/SQL? OR Can you use a DDL in a procedure ? How ? Thank you in advance.

more ▼

asked Jan 20, 2010 at 02:04 PM in Default

OracleApprender gravatar image

OracleApprender
771 71 73 75

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You can use dynamic SQL. The EXECUTE command is helpful for this. I supplied an example of that:

Elsewhere on Oracle Overflow

You can't use DDL in a regular stored procedure statement.

However, you can execute DDL with the EXECUTE statement. In fact, Oracle considers "TRUNCATE," which is in my example, to be DDL.

Here's a bit of explanation:

At Oracle-Base

more ▼

answered Jan 21, 2010 at 01:39 AM

KillerDBA gravatar image

KillerDBA
1.5k 8 9 10

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x379
x50

asked: Jan 20, 2010 at 02:04 PM

Seen: 808 times

Last Updated: Jan 20, 2010 at 02:04 PM