SQL INTERRUPT ON failure
Posted in 1993
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.
Essentially, I'm using "defer interrupt" and "options sql interrupt on"
to allow the user to interrupt out of long selects. Instead of setting
"int_flag", the program is aborting, which it shouldn't do with
interrupts deferred.
Anybody seen this, or using the feature successfully with selects?
Joey Duhon
duhon@netcom.com
===================================================================
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"
else if (quit_flag)
then display "sleep quitted"
else display "sleep completed"
end if
end if
display "going to select"
# the following select takes a long time
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
if (int_flag)
then display "select interrupted"
else if (quit_flag)
then display "select quitted"
else display "select completed"
end if
end if
end main
=================================================================
$ fglgo programgoing to sleep 5
<Hit Interrupt Here>
sleep interrupted
going to select
<Hit Interrupt Here>
Program stopped at "testint.4gl", line number 28.
SQL statement error number -213.
Statement interrupted by user.
$
=================================================================