Error when calling variable in lexical parameter [message #135242] |
Tue, 30 August 2005 11:05 |
bboo4
Messages: 1 Registered: August 2005 Location: Dubuque IA
|
Junior Member |
|
|
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
|
|
|
|