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

Home -> Community -> Usenet -> c.d.o.misc -> O9i: bind variable questions (special)

O9i: bind variable questions (special)

From: Andreas Mosmann <mosmann_at_expires-30-04-2007.news-group.org>
Date: Tue, 03 Apr 2007 12:04:24 +0200
Message-ID: <1175594664.66@user.newsoffice.de>


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> de
Received on Tue Apr 03 2007 - 05:04:24 CDT

Original text of this message

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