Re: Error trapping
Posted in 2006
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting
Try the trap outside the foreach...
Use DISPLAY a lot
Try Ctr-C instead of DEL key
J.
Guido Jimenez M. escribi':
> Fellows,
>
> I am trying to trap SQL error using the SQL INTERRUPT ON statement, but
> the program still abort when the user press the DEL key.
> Some of the program ....
>
> WHENEVER ERROR CONTINUE
> OPTIONS ....
> SQL INTERRUPT ON
>
> DECLARE q_xxx CURSOR FOR
> SELECT some_fields
> FROM some_table
> WHERE some_condition>
> FOREACH q_xxx INTO some_var
>
> IF int_flag THEN
> IF sqlca.sqlcode = -213 THEN
> ERROR "Interrupt by user"
> SLEEP 2
> RETURN
> END IF
> END IF
> END FOREACH
>
> ......
>
> Some help will be appreciate .!
>
> Thank you in advance .!!!
>
>
> ------------------------------------------------------------------------
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great
> rates starting at 1'/min.
> <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
>
>
> <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
> <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
Jean Sagi wrote:
> Try the trap outside the foreach...
> Use DISPLAY a lot
> Try Ctr-C instead of DEL key
>
>
> J.
>
> Guido Jimenez M. escribió:
> > Fellows,
> >
> > I am trying to trap SQL error using the SQL INTERRUPT ON statement, but
> > the program still abort when the user press the DEL key.
> > Some of the program ....
> >
> > WHENEVER ERROR CONTINUE
> > OPTIONS ....
> > SQL INTERRUPT ON
> >
> > DECLARE q_xxx CURSOR FOR
> > SELECT some_fields
> > FROM some_table
> > WHERE some_condition> >
> > FOREACH q_xxx INTO some_var
> >
> > IF int_flag THEN
> > IF sqlca.sqlcode = -213 THEN
> > ERROR "Interrupt by user"
> > SLEEP 2
> > RETURN
> > END IF
> > END IF
> > END FOREACH
> >
> > ......
> >
> > Some help will be appreciate .!
> >
> > Thank you in advance .!!!
> >
> >
> > ------------------------------------------------------------------------
> > Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great
> > rates starting at 1¢/min.
> > <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
> >
> >
> > <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Informix-list mailing list
> > Informix-list@iiug.org
> > http://www.iiug.org/mailman/listinfo/informix-list
> > <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
what about "DEFER INTERRUPT"