Error when calling variable in lexical parameter [message #135242] |
Tue, 30 August 2005 11:05 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
bboo4
Messages: 1 Registered: August 2005 Location: Dubuque IA
|
Junior Member |
![n%2Fa](/forum/theme/orafaq/images/yahoo.png) ![n/a](/forum/theme/orafaq/images/jabber.png)
|
|
I have a report that calls a lexical parameter for the where clause. I am passing a variable into the lexical.
Main query reads
Select item
, job
, title
from custom_table jdet
where
&variables
My program unit code looks like this. Both variables are characters. If I leave out the quotes is get a numerical error. When I add the quotes I get missing expression error.
if :p_item != 'ALL' then
return
'and jdet.item = '||'||:p_item||';
else return
'and 1=1';
end if;
if :p_reason != 'ALL' then return
'and jdet.line_reason = '||:p_reason||';
else return
'and 1=1';
end if;
Appreciate any assistance I can get.
[Updated on: Tue, 30 August 2005 11:14] Report message to a moderator
|
|
|
|