Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

To make date parameter as optional

kdAug 13 2007 — edited Aug 13 2007
Hi ,

i am trying this code ..


SELECT DISTINCT papf.full_name
FROM per_all_people_f papf,
per_all_assignments_f pav,
per_grades_tl pgt,
hr_all_organization_units haou
WHERE papf.person_id = pav.person_id
AND pgt.grade_id = pav.grade_id
AND haou.organization_id = pav.organization_id
--and papf.person_id=ppa.person_id
--and ppa.ANALYSIS_CRITERIA_ID=pac.ANALYSIS_CRITERIA_ID
AND SYSDATE BETWEEN papf.effective_start_date
AND papf.effective_end_date
AND SYSDATE BETWEEN pav.effective_start_date
AND pav.effective_end_date

AND NVL (haou.NAME, 0) =
NVL (:search_blkorganization_item, NVL (haou.NAME, 0))
AND NVL (pgt.NAME, 0) BETWEEN NVL (:search_blkgrade_from_item,
pgt.NAME
)
AND NVL (:search_blkgrade_to_item,
pgt.NAME
)
AND NVL (papf.date_of_birth,'31-DEC-4712')
BETWEEN NVL (:search_blkdob_item,papf.date_of_birth)
AND NVL (:search_blkdob_item_to,papf.date_of_birth)


i am trying to make all parameters to optional..

while i tried the nvl logic to make the date_of_birth field as optional
its giving the inconsistent data type error .

i tried with to_date,'31-DEC-4712'also ...but its giving error

anybody can help me

Regards,
kumar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2007
Added on Aug 13 2007
15 comments
1,567 views