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

Home -> Community -> Mailing Lists -> Oracle-L -> need execute immediate and script help

need execute immediate and script help

From: <rgaffuri_at_cox.net>
Date: Mon, 21 Jul 2003 16:02:02 -0400
Message-Id: <25977.338732@fatcity.com>


Im calling a script that uses dynamic sql. Im passing in a value as well. I keep getting

SP2-0552: Bind variable "2" not declared.

Here is a code snipped

declare
  v_var1 Varchar2(30) := 'TEST';
  v_var2 VARCHAR2(30) := '&1';
  total number;
begin

execute immediate ' Select * ' ||

' from user_objects '||
' where object_name = :1 '||
' or object_name = :2 '||
using v_var1,v_var2 into total;

end;
/

I call it as follows: Received on Mon Jul 21 2003 - 15:02:02 CDT

Original text of this message

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