Q

Way to create table using procedure

Is there an alternate way to create a table using a procedure?

Is there an alternate way to create a table using a procedure?
You can use the EXECUTE IMMEDIATE command in your stored procedure to run DDL to create a table, similar to the following:
CREATE PROCEDURE my_proc AS
BEGIN
   EXECUTE IMMEDIATE 'CREATE TABLE foo (bar NUMER)';
END;
/
However, it is almost always poor design to run DDL inside a stored procedure. Typically, we do no let our users create tables on the fly by running a stored proc in their application code.
This was last published in May 2006

Dig Deeper on Oracle database backup and recovery

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close