INF: Branching Within Static Batch in Embedded SQL for COBOLID: Q66751
|
WORKING-STORAGE SECTION.
EXEC SQL INCLUDE SQLCA END-EXEC
PROCEDURE DIVISION.
EXEC SQL
declare @looper int
select @looper = 1
while @looper < 11
begin
if exists (select * from authors where au_lname = "Frog")
begin
delete
from authors
where au_lname = "Frog"
end
else
begin
insert into authors values("123-45-6789","Frog","Kermit",
"206 555-1212","Sesame Street","Redmond","WA","98052",1)
end
select @looper = @looper + 1
end
END-EXEC
if sqlcode not = 0
perform sql-error
end-if
stop run.
sql-error.
display "SQL error SQLCODE=" sqlcode.
Keywords : kbprg SSrvCobol SSrvProg
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 10, 1999