Home » Developer & Programmer » Reports & Discoverer » How to display all the values if parameter values is NULL..URGENT PLZ
How to display all the values if parameter values is NULL..URGENT PLZ [message #187875] Wed, 16 August 2006 02:54 Go to next message
sireeshraju
Messages: 32
Registered: October 2005
Member

Hi

In my report which is based on the following query
select * from emp
              where deptno=:p_deptno

This will create a parameter p_deptno and I am not specifying any initial value for this.so when the report is run P_deptno will prompt to enter the deptno value for the Query where clause.If i don't specify any value in the p_deptno then my report will show no records in the report.If i specify 20 as p_deptno value then my report will show only employees from 20 deptno. Now I would like to know how to display all the emp table values even if i don't specify any value for p_deptno i.e., now my query should work as select * from emp if i don't speify p_deptno.
(remember I am not specifying the initial value for p_deptno parameter).

Any help will be highly appreciated.
Regards
Siri...
Re: How to display all the values if parameter values is NULL..URGENT PLZ [message #187880 is a reply to message #187875] Wed, 16 August 2006 03:22 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

select * from emp
where deptno= NVL(:p_deptno, deptno)
Re: How to display all the values if parameter values is NULL..URGENT PLZ [message #187988 is a reply to message #187880] Wed, 16 August 2006 10:59 Go to previous message
sireeshraju
Messages: 32
Registered: October 2005
Member

Thanks a lot wency
Previous Topic: Discoverer and LOB Type Fields
Next Topic: Unable to Maximize the Report Previewer
Goto Forum:
  


Current Time: Fri Nov 29 22:56:32 CST 2024