Home » Developer & Programmer » Reports & Discoverer » Lexcial Parameter inside PLSQL (in Formula Column)
Lexcial Parameter inside PLSQL (in Formula Column) [message #448779] |
Thu, 25 March 2010 03:17 |
ap_karthi
Messages: 87 Registered: October 2007 Location: Bangalore
|
Member |
|
|
Hello,
I am using &p to have a parameter that is going to be changed dynamically(lexical parameter). I had main query and i want to have a formula column which gets the value from the procedure. the procedure should take the parameters that i used in the main query (i mean the lexical parameters i used in the main query). but it is not possible to used lexical parameters in pl/sql. Thanks.
Karthik
|
|
|
|
Re: Lexcial Parameter inside PLSQL (in Formula Column) [message #453077 is a reply to message #448799] |
Tue, 27 April 2010 02:05 |
|
hi,
as seen from one of the thread, i tried to use the lexi parameter in my reports 6i. this is my query
select fin_yr,acc_mn,mjh_cd,smjh_cd,mih_cd,sum(nvl(CUR_AMT_P,0)-nvl(CUR_AMT_M,0)) Amount
from ta_clsf
where mjh_cd=:p_clsfn and fin_yr=:p_fin_yr
&lex_clsfn
group by fin_yr,acc_mn,mjh_cd,smjh_cd,mih_cd
order by mjh_cd,smjh_cd,mih_cd
Then created a user parameter manually and in validation trigger entered a code like this
function P_clsfnValidTrigger return boolean is
begin
if :p_clsfn is not null then
:lex_clsfn:='where mjh_cd in'||:p_clsfn;
end if;
return (TRUE);
end;
when i compile it says sql command is not ended properly
I am using this lexical parameter to select the values of mjh_cd (column name) like 8443,8050,8295,4201
could any one rectify the query and the trigger to get the result
|
|
|
|
Re: Lexcial Parameter inside PLSQL (in Formula Column) [message #453119 is a reply to message #453098] |
Tue, 27 April 2010 04:05 |
|
hi,
thanks for the reply.
i did use it within brackets only, like the way you said. but if remove the where condition in the query and just include only &lex_clsfn it works, but for me it gives all the values from the table and it does not allows me to filter the values only for a particular year.
|
|
|
|
|
Re: Lexcial Parameter inside PLSQL (in Formula Column) [message #453163 is a reply to message #453162] |
Tue, 27 April 2010 08:19 |
|
ramoradba
Messages: 2457 Registered: January 2009 Location: AndhraPradesh,Hyderabad,I...
|
Senior Member |
|
|
lacchhii wrote on Tue, 27 April 2010 18:36hi,
yes sir, i noticed it also, but i don't know how to accomodate both into the where query. could you pl guide me
:lex_clsfn := ' mjh_cd in' || :p_clsfn;
select fin_yr,acc_mn,mjh_cd,smjh_cd,mih_cd,sum(nvl(CUR_AMT_P,0)-nvl(CUR_AMT_M,0)) Amount
from ta_clsf
where &lex_clsfn and fin_yr=:p_fin_yr
group by fin_yr,acc_mn,mjh_cd,smjh_cd,mih_cd
order by mjh_cd,smjh_cd,mih_cd
sriram
[Updated on: Tue, 27 April 2010 08:25] Report message to a moderator
|
|
|
|
Re: Lexcial Parameter inside PLSQL (in Formula Column) [message #453203 is a reply to message #453194] |
Tue, 27 April 2010 20:21 |
|
select fin_yr,acc_mn,mjh_cd,smjh_cd,mih_cd,sum(nvl(CUR_AMT_P,0)-nvl(CUR_AMT_M,0)) Amount
from ta_clsf
where &lex_clsfn and fin_yr=:p_fin_yr
group by fin_yr,acc_mn,mjh_cd,smjh_cd,mih_cd
order by mjh_cd,smjh_cd,mih_cd
i did use where &lex_clsfn and fin_yr=:p_fin_yr, but it gives an error sql command not ended properly. it is accepting only one where condition and thats why i sought help from here
|
|
|
|
Goto Forum:
Current Time: Sat Nov 30 10:21:37 CST 2024
|