Subject | Re: Stored Procedure bug |
---|---|
Author | Marco Menardi |
Post date | 2002-11-20T19:20:01Z |
I don't know it this will solve your proble, but use the correct
syntax and try it inside delphi or whatever, not from QuickDesk or
other tools like that (I had very strange behaviur today running a SP
inside QuickDesk, while it worked perfectly from Delphi+Ibo... so
strange...)
so here
if (:Temp = '0') then--Also tried: "if (Temp = '0') then"
In_Begin = :In_Begin + 1;
else
Advance = '0';
remove ALL semicolons from variables name that are not inside SQL code
(SQL code needs ':' do distinguish field names from variable names,
but outside SQL code, you don't have to use them)
if (Temp = '0') then
In_Begin = In_Begin + 1; -- not :in_begin
else
Advance = '0';
syntax and try it inside delphi or whatever, not from QuickDesk or
other tools like that (I had very strange behaviur today running a SP
inside QuickDesk, while it worked perfectly from Delphi+Ibo... so
strange...)
so here
if (:Temp = '0') then--Also tried: "if (Temp = '0') then"
In_Begin = :In_Begin + 1;
else
Advance = '0';
remove ALL semicolons from variables name that are not inside SQL code
(SQL code needs ':' do distinguish field names from variable names,
but outside SQL code, you don't have to use them)
if (Temp = '0') then
In_Begin = In_Begin + 1; -- not :in_begin
else
Advance = '0';
--- In ib-support@y..., Gerhardus Geldenhuis <gerhardus@s...> wrote:
> 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