Subject | Re: I'm really new to storedProc and need a little help |
---|---|
Author | dixonepperson |
Post date | 2003-08-25T19:09:06Z |
--- In firebird-support@yahoogroups.com, Milan Babuskov <albis@e...>
wrote:
statement, so I was getting error 206 and then before, it just
wouldn't work. wasn't sure why. Anyway, Thanks
Dixon
wrote:
> Milan Babuskov wrote:INTO :hightn;
>
> And now I see it's all wrong. Here's the corrected version:
>
> SET TERM !! ;
> CREATE PROCEDURE GETPAYNUM RETURNS (hightn INTEGER) AS
> BEGIN
> SELECT LU_RATE FROM LUTABLE WHERE LU_FIELD='PYNUM'
> IF (hightn IS NULL) THENLU_FIELD='PYNUM';
> BEGIN
> INSERT INTO LUTABLE (LU_DESC,LU_FIELD,LU_RATE,LU_ORDER,LU_DEF)
> VALUES ('PayNumber', 'PYNUM', 1, 0, 'N');
> hightn = 1;
> END
> ELSE
> BEGIN
> UPDATE LUTABLE SET LU_RATE=LU_RATE +1 WHERE
> hightn = hightn + 1;Thats it!! Thanx. The procedure couldn't see the LU_RATE in the if
> END
> SUSPEND;
> END!!
> SET TERM ; !!
>
statement, so I was getting error 206 and then before, it just
wouldn't work. wasn't sure why. Anyway, Thanks
Dixon