Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Dynamic SQL

Dynamic SQL

From: <NeedaHoliday>
Date: Fri, 12 Jan 2001 14:05:31 -0500
Message-ID: <p3lu5tc5qoobrs19fbofefh1gd1ncmoqj6@4ax.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US