Subject Re: [ib-support] Stored Procedure bug
Author Gerhardus Geldenhuis
Daniel Rail wrote:
> At 18/11/2002 11:10 AM, you wrote:
>
>
>>The problem is
>>
>> select workingday from workingdays
>> where sortorder = (select result from dayofweek_select(:In_Begin))
>> into Temp;
>
>
> Make the following correction:
>
> into :Temp;
>
> Notice the semi-colon before the variable Temp.
>

I added it but it makes no difference.
The code looks like this now:
SET TERM ^! ;
CREATE PROCEDURE CHECK_WORKINGDAYSTEMP (IN_BEGIN Date) returns (OUT_DATE
Date) AS
DECLARE VARIABLE Advance varChar(1);
declare variable Temp varchar(1);

declare variable Counts Integer;

begin
Counts = 0;
Advance = '1';

while (Advance = '1') do
begin
Counts = Counts + 1;
select workingday from workingdays
where sortorder = (select result from dayofweek_select(:In_Begin))
into :Temp;

if (:Temp = '0') then--Also tried: "if (Temp = '0') then"
In_Begin = :In_Begin + 1;
else
Advance = '0';

if (Counts = 10) then
Advance = '0';
end

Out_Date = In_Begin;

end

^!
SET TERM ; ^!

Groete
Gerhardus