Home » Developer & Programmer » Reports & Discoverer » Error when calling variable in lexical parameter
Error when calling variable in lexical parameter [message #135242] Tue, 30 August 2005 11:05 Go to next message
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

Re: Error when calling variable in lexical parameter [message #135384 is a reply to message #135242] Wed, 31 August 2005 07:04 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
u need to put '''' instead of '

if :p_item != 'ALL' then 
return 'and jdet.item = '||''''||p_item||'''';
else return 'and 1=1';
end if;
Previous Topic: how to scroll down a report
Next Topic: Grid format in tabular report.
Goto Forum:
  


Current Time: Sun Jun 23 14:37:09 CDT 2024