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 -> Re: Dynamic SQL

Re: Dynamic SQL

From: David Fitzjarrell <oratune_at_aol.com>
Date: Fri, 12 Jan 2001 19:41:08 GMT
Message-ID: <93nmki$ua7$1@nnrp1.deja.com>

In our last gripping episode NeedaHoliday wrote:
> 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
>

It would help greatly to know what errors you are generating.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com
http://www.deja.com/
Received on Fri Jan 12 2001 - 13:41:08 CST

Original text of this message

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