How to validate user parameters in Oracle Reports 6i?

5 pts.
Tags:
Oracle Reports
Oracle Reports 6i
Oracle Reports 6i User Parameters
SQL
Hi! I am using Oracle reports 6i to modify a standard report. I need to add two user parameters and a field retrieved should be between them if they are not left blank. If they are left blank, then, they should not be taken into consideration. My problem is: These two parameters are included in my SQL, how do i validate it?? Please help me. Thank you.
ASKED: February 27, 2009  5:00 AM
UPDATED: June 12, 2011  9:23 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

The WHERE clause of the query should contain a condition like this:

<pre>WHERE field_x between NVL(:parameter_1,field_x) AND NVL(:parameter_2,field_x)</pre>

This way, when the parameters are null, field_x will be compared to itself, nullifying the condition.

You can use Decode( ) (that work like IF.. Then .. Else.. End IF)
by using Decode you can compare your parameters .

Decode ( :Parameter1 ,100,1,
200,2,
300,3,
4)

Here if value of parameter1 is 100 then return value is 1.
if value of parameter1 is 200 then return value is 2. … … .. ..
if value of parameter1 not match then return value is 4. (this is ELSE condition

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Oracle786
    how we create report user parameter on report like this ( customer name search by name and select data by customer code ) . please give answer
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following