For fun I modified Ted Holts example. Works great to trap errors.

Richard Schoen
Email: richard@xxxxxxxxxxxxxxxxx

create or replace procedure QGPL.CreatePlants

set option dbgview = *source,
commit = *none

declare v_Error char(1) default '0';
declare v_ErrorCount integer default 0;

declare Table_Exists condition for sqlstate '42710';
declare Table_NotFound condition for sqlstate '42704';

declare continue handler for Table_Exists
set v_Error = '1';
set v_ErrorCount = v_ErrorCount + 1;

declare continue handler for Table_NotFound
set v_Error = '1';
set v_ErrorCount = v_ErrorCount + 1;

-- Drop table. Error handled by Table_NotFound
drop table qgpl.plants;

-- Drop table. Error handled by Table_Exists
create table qgpl.plants
( ID dec(3), Location varchar(16),
primary key (ID));
label on table plants is 'Plant master';


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.