Method R Discussion Group

Method R helps developers, DBAs, and decision-makers optimize Oracle-based software in every phase of the software life cycle.

Discuss Method R products, techniques, and events.

Ask new questions or post your own responses.

Bind variables in SQL Developer

Need some help in using bind variables via the SQL Developer plugin.  I enter the following and when running the query get the error:

variable ORG_ID number;
variable FAC_ID number;
variable ORD_DIM_ID number;
variable SEQ_NBR number;
variable SCH_DT varchar2(20);

exec :ORG_ID := 321
exec :FAC_ID := 371
exec :ORD_DIM_ID := 23
exec :SCH_DT := trunc(sysdate)
exec :SEQ_NBR := 1

query here......

anonymous block completed
anonymous block completed
anonymous block completed
anonymous block completed
anonymous block completed
Bind Variable "org_id" is NOT DECLARED

It runs fine in SQL*Plus.
John Thompson Send private email
Tuesday, February 26, 2008
 
 
Bind variables appear to work fine for me. Perhaps the problem is in the part of your example which was omitted (the query). Try this:

variable org_id number
exec :org_id := 1
select * from dual where :org_id = 1;

This worked for me in version 1.2.1.3213
Ron Crisco Send private email
Tuesday, February 26, 2008
 
 
did not know there is a pluggin which will allow binds in sqlDev. Did not see it on otn. where can it be obtained from?
Peter Shankey Send private email
Tuesday, February 26, 2008
 
 
No plugin is necessary. The SQL Developer team has implemented many features which allow execution of SQL*Plus scripts "as-is" for ease of testing.
Ron Crisco Send private email
Tuesday, February 26, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Discussion Groups Main Page

Powered by FogBugz