|bind variables to package procedure call stored in table [message #184073]
||Tue, 25 July 2006 03:46
Registered: July 2006
I have a table where I store dynamic SQL statements that will be called using bind variables.
I want to use a call to a package procdure doing some DML, e.g. updating a table, therefore I save the string:
into the table.
When I try to use the procedure call via the code:
vBindVar NUMBER := 5;
select the_stmt into vStmt from table_with_stmts where id = '24';
execute immediate vStmt
I get the following error:
ORA-06550: line 1, column 7:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin declare exit for goto if loop mod null pragma raise
return select update while <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall
<a single-quoted SQL string>
The symbol "" was ignored.
Is there a way to do what I want without "binding" the variable by myself, e.g. using replace functionality?