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!

to insert values dynamically into the dynamic table

593275Jan 11 2008 — edited Jan 14 2008
Hi All,


I have created one procedure which creates table structure dynamically i.e if client pass the No. of columns from front end then based on that table will be created in database dynamically through procedure.I have done succesfully this.

Now I am stuck in inserting values in the table dynamically. I have written procedure for that.. But i m getting error.Below is the code.Please help me out in solving this problem ...


q:='''insert into '||table_name||'(';
for i in 1..v_column loop
q:=q||'col'||i||',';
end loop;
q:=q||'aaa';
q:=replace(q,',aaa',')');
q:=q||' values (';
for i in 1..v_column loop
q:=q||':'||i||',';
end loop;
--dbms_output.put_line (q);
q:=q||'exppp';
q:=replace(q,',exppp','')||')''';
q:=q || chr(13) || ' USING ';
for i in 1..v_column loop
q:=q|| chr(13) || ' v_data_array '||'('||i||')'',''';
end loop;
q:=q||'zzzzz';
q:=replace(q,',zzzzz',' ; ');
execute immediate q;



It would be very helpful to me if i get solution for this problem. Thanks in advance.


Regards
Dhan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2008
Added on Jan 11 2008
5 comments
1,608 views