Hello Stefan,

first of all you will only see performance differences if you are
executing many queries with a lot of different parameter values. And
of course it depends on the database you are using. Some database
systems will show no difference at all. Some other will be able to
optimize the SQL analyzing and execution stepts only if you use
parameter binding, but not if you use constants (e.g. Oracle below
version 9). And some more databases are even able to optimize access
though you are using constants (e.g. newer Oracle versions). However
it's always better to use parameter binding and to avoid dynamically
created sql statements including constant values. Many Database
administrators will complain about many executed similar SQL
statements without parameter bindings because they use up a lot of SGA
memory.

Regards,

   Martin

2007/1/4, Stefan Lober <[EMAIL PROTECTED]>:
Hello,

I have a short question about OQL query performance:
Does it make any difference if I put a query parameter
into the query string or if I use a placeholder and
bind the parameter to the query?
An example:
select o from test.Data o where member = "something"
vs.
select o from test.Data o where member = $1
(and the binding "something" as the first parameter)

Regards
Stefan

--
Martin Fuchs
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to