Home » RDBMS Server » Server Administration » Using variables instead of constants
Using variables instead of constants [message #370509] Fri, 10 December 1999 14:20
AT
Messages: 14
Registered: July 1999
Junior Member
I'm tuning my app and trying to use variables instead of constants to reduce parse time. Unfortunately I have no idea how to do this:

I send a series of statements over ODBC like:
SELECT f1, f2 FROM table1 where field3=19
SELECT f1, f2 FROM table1 where field3=87
SELECT f1, f2 FROM table1 where field3=44
etc...
To re-use the parsed statement already in memory from the very first statement, I tried:
SELECT f1, f2 FROM table1 where field3=:myvar

but I get a "Not all variables bound" error.
I tried to replicate what I do in SQL*Plus

("variable myvar number" and "begin :myvar :=10; end;")

but I get a "invalid SQL statement" for "variable myvar number". How can I do this?? Thanks in advance,
-AT
Previous Topic: trouble with dynamic pl sql Oracle 7.3.4
Next Topic: urgent
Goto Forum:
  


Current Time: Thu Mar 28 21:31:53 CDT 2024