x
login about faq Site discussion (meta-askssc)

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 '10 at 02:04 PM in Default

OracleApprender gravatar image

OracleApprender
763 53 66 73

(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 '10 at 01:39 AM

KillerDBA gravatar image

KillerDBA
1.5k 5 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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x359
x50

asked: Jan 20 '10 at 02:04 PM

Seen: 361 times

Last Updated: Jan 20 '10 at 02:04 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.