Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Dynamic SQL
Can someoneplease tell how to create aprocedure that will accept input as follows;
Table_Name
IN_Column_nm
IN_Input_data
Create dynamic SQL to create the following and execute
--Prepare cursor to select rowids of the records to be deleted. v_Insert_Stmt :=
'INSERT INTO '||IN_Tname||' ('|| IN_Field_Parms || ')' ||' VALUES ( || :Input_Parms || )';
v_Sel_Id := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(v_Sel_Id,v_Insert_Stmt,dbms_sql.v7);
DBMS_SQL.BIND_VARIABLE(v_Sel_Id, ':Input_Parms', IN_Input_Parms);
v_Exec_Sel := DBMS_SQL.EXECUTE(v_Sel_Id);
DBMS_SQL.CLOSE_CURSOR(v_Sel_Id);
END;
I want to be able to send any table with its columns and input data
and create the SQL.
I keep getting errors.
Thanks in advance
Jim
james.stewart_at_nospamPWGSC.GC.CA Received on Fri Jan 12 2001 - 13:05:31 CST