[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Report performance



This is a follow on to a previous message.  I have a large number of
reports which are generated for which the query is identical except for a
location, so I am trying to parameterize the query so the Oracle parser
will only parse it once.  The skeleton of the query is like this:

begin-select
...
from ...
where....
and location in $locations

By doing it this way, the SQL statement ends up with a :1 where $locations
is and each time the query is executed after the first time, it wont need
to be reparsed since Oracle will see it as the same query.

But I dont understand why this wont work.  I even tried hardcoding it like
this:

let $locations='''4632'''
print $locations (+1,1)
..
..
begin-select
...
from ...
where....
and location in $locations

The print $locations confirms $locations does indeed contain  '4632'

But what blows me away is that the following (which seems identical) DOES
WORK - can anyone explain why???

begin-select
...
from ...
where....
and location in '4632'

Why does it work with the literal but not the string?  Thanks for any
insight.