Re: SYSTEM.CURRENT_FIELD
Date: 22 Jun 1993 16:08:39 GMT
Message-ID: <dewey-220693121914_at_sebastian.centerline.com>
In article <1993Jun22.152922.25719_at_news.unomaha.edu>,
moswald_at_cwis.unomaha.edu (Mike Oswald) wrote:
>
> I have since turned my question/problem over to Oracle due to the following
> error messages.
>
> PL/SQL error 903 at line 4, column 34:
> bind variable 'global.temp_out' may not be an OUT parameter
>
> The following KEY-ENTER trigger and procedure caused the error:
>
> KEY-ENTER
> if <block.field> is not null then
> :global.temp_date := substr(to_char(<block.field>),1,6) ;
> convert_date (:global.temp_date, :global.temp_out) ;
This is your problem. You may not pass a global variable to a procedure if the procedure wants to write to the variable.
> <blah-blah>
> else
> <block.field> := sysdate ;
> end if ;
>
> PROCEDURE:
> procedure convert_date (date_in in char, date_out out date) is
> temp date;
> begin
> temp := to_date(date_in, 'MMDDYY') ;
> date_out := temp ;
> end ;
Define a local variable in the trigger and pass that to the procedure, or just use the global variables. You do not have to pass the variables if they are global.
SOLUTION 1
KEY-ENTER
declare
local_temp_out date;
begin
if <block.field> is not null then
:global.temp_date := substr(to_char(<block.field>),1,6) ; convert_date (:global.temp_date, local_temp_out) ; :global.temp_out := local_temp_out; <blah-blah> else <block.field> := sysdate ;
end if ;
end;
PROCEDURE:
procedure convert_date (date_in in char, date_out out date) is
temp date;
begin
temp := to_date(date_in, 'MMDDYY') ;
date_out := temp ;
end ;
SOLUTION 2
KEY-ENTER
if <block.field> is not null then
:global.temp_date := substr(to_char(<block.field>),1,6) ; convert_date ;
<blah-blah>
else
<block.field> := sysdate ;
end if ;
PROCEDURE:
procedure convert_date (date_in in char, date_out out date) is
temp date;
begin
temp := to_date(:global.temp_date, 'MMDDYY') ;
:global.temp_out := temp ;
end ;
SOLUTION 3 (My personal choice if you have >= 6.0.36)
KEY-ENTER
declare
new_date date;
begin
if <block.field> is not null then
new_date := convert_date(substr(to_char(<block.field>),1,6)) ; <blah-blah> else <block.field> := sysdate ;
end if ;
end;
PROCEDURE
function convert_date (date_in in date) return date is
begin
return to_date(date_in, 'MMDDYY');
end;
Devan F. Dewey | Senior Systems Analyst CenterLine Software | dewey_at_centerline.com 10 Fawcett Street | "Leme esplain - no dere is Cambridge, MA 02138 | too much. Leme sum up." -Inigo MontoyaReceived on Tue Jun 22 1993 - 18:08:39 CEST