Q
Problem solve Get help with specific problems with your technologies, process and projects.

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.

Dig Deeper on Oracle database backup and recovery

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.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close