Home » Developer & Programmer » Reports & Discoverer » Error A READ-ONLY bind variable used in OUT or IN-OUT context (report6i)
Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #409814] Wed, 24 June 2009 03:11 Go to next message
aiyaz_ma
Messages: 56
Registered: May 2009
Location: Hyderabad
Member

Hello All,

I have used this code in formula column of my report. but an error

Error A READ-ONLY bind variable used in OUT or IN-OUT context

The error is at :STATUS :='L';

Can any one please let me know what the solution for this ?


This is the code

function CF_ORDER_STATUSFormula return Varchar2 is
x date;
begin
select DATE_SCHEDULED+1 into x from wsh_delivery_details;
if ( :STATUS in ('R', 'Y')
And ( rtrim(:CF_ORDER_DISPATCHED) is not null )) then
if :ASOF_DATE > x + 21 then
:STATUS:='L';
return :CF_ORDER_DISPATCHED;
else
return :STATUS;
end if;
end if;
end;


Thanks
Aiyaz
Re: Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #409861 is a reply to message #409814] Wed, 24 June 2009 04:45 Go to previous messageGo to next message
cookiemonster
Messages: 12409
Registered: September 2008
Location: Rainy Manchester
Senior Member
What is :status?
Re: Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #409862 is a reply to message #409814] Wed, 24 June 2009 04:48 Go to previous messageGo to next message
aiyaz_ma
Messages: 56
Registered: May 2009
Location: Hyderabad
Member

Hi,

Its a Data base column

My requirement is if the schedule date is >21 days then at the STATUS feild i have to get 'L'

Hope u got cleared now

Reply me for any other queries

Thanks
Aiyaz
Re: Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #409919 is a reply to message #409814] Wed, 24 June 2009 07:54 Go to previous messageGo to next message
cookiemonster
Messages: 12409
Registered: September 2008
Location: Rainy Manchester
Senior Member
Just put your logic in the main query.
You don't need a formula column for this.
Re: Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #409995 is a reply to message #409919] Wed, 24 June 2009 14:59 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
By the way, unless "wsh_delivery_details" table always contains one row, your code might end up with an error (such as TOO-MANY-ROWS or NO-DATA-FOUND).
Re: Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #410050 is a reply to message #409995] Wed, 24 June 2009 23:40 Go to previous messageGo to next message
aiyaz_ma
Messages: 56
Registered: May 2009
Location: Hyderabad
Member

Hi,
Thanks for the reply

Yes you are right it returns more than 1 rows so i updated the code like this
but when i declare variable x and assigning 'L' to it and run the report then at the run time it gives formula column does not return any value.so, Instead i have created one more formula column in which it will return 'L'. Its working fine now but for some cases its returning 'R' with out checking the if condition of date >21.

Could you please get me a solution for this why its happening.





function CF_ORDER_STATUSFormula return Varchar2 is
--x varchar2(1):='L';
begin

if ( :STATUS in ('R', 'Y')
And ( rtrim(:CF_ORDER_DISPATCHED) is not null )) then
if :ASOF_DATE > :AVAIL_EXP_SHIP_DT + 21 then
return :CF_SCHEDULE;
--return x;
--:STATUS:='L';
end if;
return :CF_ORDER_DISPATCHED;
else
return :STATUS;
end if;
end;
Re: Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #410132 is a reply to message #409814] Thu, 25 June 2009 07:20 Go to previous messageGo to next message
cookiemonster
Messages: 12409
Registered: September 2008
Location: Rainy Manchester
Senior Member
What happens when :CF_ORDER_DISPATCHED is null?
Re: Error A READ-ONLY bind variable used in OUT or IN-OUT context [message #410138 is a reply to message #410132] Thu, 25 June 2009 07:36 Go to previous message
aiyaz_ma
Messages: 56
Registered: May 2009
Location: Hyderabad
Member

Thanks for all your support

Finally i got updated the code like this

function CF_ORDER_STATUSFormula return Varchar2 is
begin

if ( :STATUS in ('R', 'Y')
And ( rtrim(:CF_ORDER_DISPATCHED) is not null )) then
return :CF_ORDER_DISPATCHED;
else
if :AVAIL_EXP_SHIP_DT > :ASOF_DATE+ 21 then
return :CF_SCHEDULE;
else
return :STATUS;
end if;
end if;
end;


Hope there is no issues in it...
Thanks

Aiyaz
Previous Topic: report is not printing all information
Next Topic: literal does not match format string
Goto Forum:
  


Current Time: Wed Dec 07 03:19:00 CST 2016

Total time taken to generate the page: 0.05287 seconds