Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> O9i: bind variable questions (special)
Hi ng,
maybe that questions sound a bit stupid:
If I use bind variables in queries I can increase the performance
because
a) the statement is parsed only 1 time
b) a statement keeps in cache longer because the same statement with
different parameters still is the same statement.
1st Question:
If I want to do this in an application there is no problem
SELECT * FROM T1 WHERE T1.F1=:MyParam;
:MyParam :='A';
But if I work f.e. with SQL worksheet, can I write it in any way like {:MyParam :='A'} SELECT * FROM T1 WHERE T1.F1=:MyParam;
2nd Question:
A query
SELECT * FROM T1 WHERE T1.F1='A';
can be translated into
SELECT * FROM T1 WHERE T1.F1=:MyParam;
Is there a way to translate
SELECT * FROM T1 WHERE T1.F1 in ('A','B');
into
SELECT * FROM T1 WHERE T1.F1 in (:MyParamList);
?
If not the consequence is that there is no possibility to avoid parsing
if you have queries like
SELECT * FROM T1 WHERE T1.F1 in ('A','B');
SELECT * FROM T1 WHERE T1.F1 in ('A','D','F');
Is this right?
sorry for that questions, but I did not find an answer by google or by Manual. bind variable is a bad keyword
Andreas Mosmann
-- wenn email, dann AndreasMosmann <bei> web <punkt> deReceived on Tue Apr 03 2007 - 05:04:24 CDT
![]() |
![]() |