Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: [newbie] bind variables
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.
![]() |
![]() |