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

Home -> Community -> Usenet -> c.d.o.server -> Re: [newbie] bind variables

Re: [newbie] bind variables

From: tojo <Tojo_at_hotmail.com>
Date: Wed, 27 Aug 2003 12:16:28 +0200
Message-ID: <MPG.19b6a3582a90353798969f@news.t-online.de>


In article <q4%2b.268595$Ny5.8263211_at_twister2.libero.it>, franz_at_mail.com says...
> Hi all,
> I'm using a SQL statement from inside a Java function.
> The statement is a PreparedStatement, that is:
>
> select * from table1 where field1 = ?
>
> then in the code I set at runtime "field1" with the desired value.
> Now my question is: will Oracle use bind variables when I issue a statement
> like
> this ? I'd like to avoid to have my statement re-parsed every time.
>
> A further question: how do you check on the DB that a statement has been
> parsed ?
>

Yes your statement will use bind variables.

You can get the details to any statement (parses, executions, etc.) from the view V_$SQL. The field SQL_TEXT will have something like:

  select * from table1 where field1 = :1

which is proof it is using binds.

Received on Wed Aug 27 2003 - 05:16:28 CDT

Original text of this message

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