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

Home -> Community -> Usenet -> c.d.o.misc -> table driven dynamic sql / automating bind_variable.

table driven dynamic sql / automating bind_variable.

From: <ssharma_at_clearnet.com>
Date: Tue, 19 May 1998 16:06:39 GMT
Message-ID: <6jsamg$ppf$1@nnrp1.dejanews.com>


Hello, I hope someone can help me with this.

I am storing dynamic sql statements in a table. Here's one proposed structure.

create table itdevel_dynamic_sqls (
id number not null
,group_name varchar2(100)
,program varchar2(100)
,statement long

);

The statement column holds the actual statement, the plan is to run up to 100 dynamic sql statements just by opening a cursor on the table, order by id and loop through the statements, parsing and executing as we go.

The problem is each statement may have up to 5 bind variables and I can see no way to do a variable number of

dbms_sql.bind_variable ()

Add the fact that
PL/SQL has no concept of references / dereferencing , so it seems the bind_variable command must be hard coded for each variable to be bound, this scheme seems unworkable.

I want to avoid concatenating the bind variables into the statements because many other people may be modifying the statement, and if any one of them is confused about the quoting convention in varchar strings, they could really screw
things up.

Any hints appreciated.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Tue May 19 1998 - 11:06:39 CDT

Original text of this message

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