Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: insert into table , where the table name is a parameter
Hi
You can use dbms_sql package to create sql satement at runtime. It looks like:
CREATE OR REPLACE PROCEDURE insert_into_table(tab_name IN VARCHAR2) AS
c INTEGER;
rows INTEGER;
BEGIN
c := dbms_sql.open_cursor;
dbms_sql.parse(c, ’insert into ‘||tab_name||’
values <your_values>’, dbms_sql.native);
rows := dbms_sql.execute(c);
dbms_sql.close_cursor(c);
END;
Regards,
Michael
Brainbench MVP for Oracle Programming
http://www.brainbench.com
tsachis_at_boi.gov.il (zachi) wrote in message news:<6af31984.0206062226.10454d6c_at_posting.google.com>...
> Hi
> I want to write a procedure that insert into table which its name is pass
> to the procedure as a parameter
> i.e
> procedute temp(tab varchr2) is
> begin
> insert into temp values(etc...)
> ofcourse that the tab name erresent a table which has the appropiate coloums
> please help me
> p.s
> what is IN parameter
Received on Fri Jun 07 2002 - 07:37:53 CDT