Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

create table dynamically

itzkashiDec 22 2017 — edited Feb 16 2018

Hi ,

i need to create the tables dynamically through procedure based on the table below. there is a UI application which will accept the parameters as mentioned in the table below and upon saving It should create the table .could be a mutilple insert at a time from UI  along with constraints. Could you help me to achieve this.

  CREATE TABLE "TABLE_DETAIL"

   ( 

"TABLE_NAME" VARCHAR2(50 CHAR),

"COLUMN_NAME" VARCHAR2(30 CHAR),

"DATATYPE" VARCHAR2(10 CHAR),

"COLUMN_WIDTH" VARCHAR2(10 CHAR),

"ISNULL" VARCHAR2(5 CHAR),

"PRIMARY_KEY" VARCHAR2(5 CHAR)

   ) ;

  

  

  insert into TABLE_COL_DETAIL values ('EMPLOYEE','EMP_ID','VARCHAR2','10','N','Y');

    insert into TABLE_COL_DETAIL values ('EMPLOYEE','FIRST_NM','VARCHAR2','10','N','N');

     INSERT INTO TABLE_COL_DETAIL VALUES ('EMPLOYEE','EMAIL','VARCHAR2','10','Y','N');

commit;

thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 16 2018
Added on Dec 22 2017
40 comments
1,334 views