Creating Table dynamically in Oracle Procedure

How can we create a table inside an Oracle procedure.

"CREATE TABLE tableName AS". We cannot execute this statement in procedures because upon creation of procedure it would give syntax error.

We can implement this with the help of EXECUTE IMMEDIATE command and then dynamically create table.

create or replace procedure Proc1 as
begin
execute immediate ‘create table NewTable(column1 integer )’;
end ;

Popularity: unranked [?]

Filed Under: Oracle

Tags:

About the Author:

RSSComments (0)

Trackback URL

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.