Re: NEED HELP debugging stored procedure
Posted in 1995
Michael Stenzler — — source: Informix-list mailing list archive (1991-1998)
In article <3ksmos$2ag@panix2.panix.com> M. Stenzler, rpcg@panix.com
writes:
I've found & corrected a logic bug in my SP as follows:
>//start
>
>CREATE PROCEDURE sp_iscidok ( q_cid char(6)) returning int;>BEGIN
>
> define rval int;
> define x_cid char(6);
> define sqlerr int;
>
> ON EXCEPTION SET sqlerr
> if sqlerr = 100 then
> return 0;
> else
> return -1; <----- changed from 1
> end if
>
> select unique cid into x_cid from client where cid = q_cid;>
return 1; <------ added return for OK result
> END EXCEPTION
>END
>END PROCEDURE
>
>//end
This now works but I would still appreciate any comments on debugging
technique, SP logic tricks, etc..
Thanks
Mike