Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Sanjay Rao — — source: Informix-list mailing list archive (1991-1998)
Sanjay Rao wrote:
>
> Hi:
>
> Can someone help with the following stored procedure?
> I am trying to insert a row in a table based on a select
> statement returning no rows from a different table. The
> on exception does not appear to set the esql to 100
> (SQLNOTFOUND). Is there some other value that I must check?
>
> Any help is appreciated:
>
> Thank you
> Sanjay
> email rao00008@mc.duke.edu
>
> ************START OF PROCEDURE ****************************
> create procedure test (xyz varchar(10))
> returning int;>
> define tmp varchar(10);
> define esql int;
>
> on exception set esql
> select name into tmp from temptable where name = xyx;
> end exception with resume;
>
> if (esql = 100) then
>
> insert my row
> end if
> end procedure
>
> ********************END OF PROCEDURE ******************
Thanks to all those responded.
The solution that I used was to check for error number -239 (duplicate
value in an index)
Sanjay
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.