Re: SQL INTERRUPT ON failure
Posted in 1993
Joey Duhon writes: } }I'm having trouble getting the 4GL 4.10 feature "sql interrupt" to work. }I'm using the p-code runner with both the 4.10 and 5.0 ONLINE engine }on SCO UNIX. } lines deleted. You need to add some error handling. I have only been able to test it with c4gl, but your program beheaves like you describe when I compile with c4gl. Modified version of test program follows. }=================================================================== }database grid } }main } define temp int } } defer interrupt } defer quit } options sql interrupt on } } let int_flag = 0 } let quit_flag = 0 } } display "going to sleep 5" } } sleep 5 } } if (int_flag) } then display "sleep interrupted" LET int_flag = 0 -- Line inserted } else if (quit_flag) } then display "sleep quitted" LET quit_flag = 0 -- Line inserted } else display "sleep completed" } end if } end if } } display "going to select" } } # the following select takes a long time WHENEVER ERROR CONTINUE -- Line inserted OPTIONS SQL INTERRUPT ON -- Line inserted } select count(*) into temp } from security, opt, issuer } where security.death_date is null } and issuer.iss_id = security.iss_id } and security.security_id = opt.security_id WHENEVER ERROR STOP -- Line inserted OPTIONS SQL INTERRUPT OFF -- Line inserted } } if (int_flag AND STATUS = -213) -- Line modified } then display "select interrupted" } else if (quit_flag) } then display "select quitted" } else display "select completed" } end if } end if } }end main -- ----\\ Pro Informatic Aps. Niels Berner <berner@proinf.dk> | O | Jagtvej 111A, DK-2200 Copenhagen N. Denmark +-|-/ Phone: +45 35 82 36 36 Fax: +45 35 82 36 37 | | #include <disclaimer.h>