Report Query

To discuss Oracle Forms & Reports related technical issues.
Post Reply
najm
Posts: 74
Joined: Wed Apr 05, 2006 8:04 am
Location: Pakistan

Report Query

Post by najm »

Report query is
select *
from emp
where ((:p_losal is not null and :p_hisal is not null and sal between :p_losal and :p_hisal) or (:p_losal is null or :p_hisal is null)) /* by this between query if I am not entered any amount, report shows all the records and if I entered any value reports shows entered value records.

but when I use another parameter like this
and deptno =:p_eno /* and enter the deptno it show the records of the selected dept only. But I want when I am not entered any dept no in the parameter the reports must be run and shows all the records.

Najm
admin
Posts: 2063
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post by admin »

The best option I would suggest is to use lexical references and build your where condition before report trigger.
mirza_rehan
Posts: 132
Joined: Sun Apr 02, 2006 10:36 am
Location: Pakistan

Post by mirza_rehan »

You write this query....

select * from emp
where (sal between :p_losal and :p_hisal or (:p_losal is null or :p_hisal is null))
and (deptno =:p_Deptno or :p_deptNo is Null)

i think i will resolve you problem but still problem exist please reply or call me


Best regards,
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
Cell: +92-304-2120807

When ever you pray
Please remember me and my family
najm
Posts: 74
Joined: Wed Apr 05, 2006 8:04 am
Location: Pakistan

Post by najm »

thanks it works but a little problem exists is that

1) when i select Blank Value for view those records which are null but it show all records as well as Entered values but i only wants null records.


2) and when i select any entered value it shows only entered value it's ok.

Please resolve my problem no 1 .
and Thanks for taking Interest


Chears

Najm
mirza_rehan
Posts: 132
Joined: Sun Apr 02, 2006 10:36 am
Location: Pakistan

Post by mirza_rehan »

Assalam-o-Alaikum

Najam for this task lexical references are best and there is one way also soo please mail me you report i will corrected please mail me at: mirza_rehan@yahoo.com and if any urgency please call me

Best regards
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
Cell: +92-304-2120807

When ever you pray
Please remember me and my family
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests