how to make prametes as optional in reports 6i [message #430990] |
Fri, 13 November 2009 09:57 |
sivaora
Messages: 119 Registered: October 2009 Location: Hyderabad
|
Senior Member |
|
|
hi all,
i have created my report with 4 parameters like
1.p_empno_from
2.p_empno_to
3.p_deptno_from
4.p_deptno_to
By using this query in datamodal,
select * from emp
where empno between :p_empno_from and :p_empno_to
and deptno between :p_deptno from and :p_deptno_to;
Now i want to make :p_deptno_from and :p_deptno_to as optional.
when i give two parameters of empno then the query will be executed.
how to do this,can any one knows please reply me soon.
thanks in advance.
|
|
|
|
|
|
|
Re: how to make prametes as optional in reports 6i [message #431010 is a reply to message #430990] |
Fri, 13 November 2009 11:20 |
sivaora
Messages: 119 Registered: October 2009 Location: Hyderabad
|
Senior Member |
|
|
i want to do this functionality because, i want to learn the scenarios by practically,how can we expect only one solution which is known for us is suitable for all the requirements.
and the thing is that 'if you know then reply me' is i recieved the solution for my first requirement, and again i am giving another requirement,if you know solution for this also then reply me,thats why i posted it.
|
|
|
Re: how to make prametes as optional in reports 6i [message #431013 is a reply to message #430995] |
Fri, 13 November 2009 11:35 |
cookiemonster
Messages: 13962 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
sivaora wrote on Fri, 13 November 2009 16:16thank you for your reply,
i done it.
But i want to make the parameters :p_deptno_from and :p_deptno_to
as optional in property palette by using 'validation trigger'.
if you know then reply me.
thank you.
Unless I'm missing something here parameters are optional by default. So why do validation triggers have anything to do with it?
|
|
|
Re: how to make prametes as optional in reports 6i [message #431023 is a reply to message #430990] |
Fri, 13 November 2009 12:31 |
sivaora
Messages: 119 Registered: October 2009 Location: Hyderabad
|
Senior Member |
|
|
parameters are not optional by default.
if you are not entering any value in to the parameters then null values will by substituted in query.
in my above example if i am not making the parmaetes for deptno as optional and i am not entering any values then null will be substitued in query and we are not getting any output.
that's why we have to make the parameters as optional.
|
|
|
|
Re: how to make prametes as optional in reports 6i [message #431255 is a reply to message #431023] |
Mon, 16 November 2009 05:59 |
cookiemonster
Messages: 13962 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
sivaora wrote on Fri, 13 November 2009 18:31parameters are not optional by default.
if you are not entering any value in to the parameters then null values will by substituted in query.
in my above example if i am not making the parmaetes for deptno as optional and i am not entering any values then null will be substitued in query and we are not getting any output.
that's why we have to make the parameters as optional.
We've got different definitions of optional here. When I say optional I mean don't specify a value so null gets passed.
Assuming you can't have null deptno's in your table then passing null is fine and the query I supplied above will work.
Otherwise you need to use a lexical parameter as suggested by Littlefoot.
|
|
|