Re: sqlca in stored procedures
Posted in 1996
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Triggers, Constraints & Referential Integrity
At 05:00 AM 6/7/96 GMT, Carlos Costa e Silva wrote:
>I'm starting to use stored procedures in triggers mainly to guaranty
>referential integrity on the database, and need to know when an update or
>delete has not found any rows, that is, if sqlcode = 100 or sqlerrd[3] > 0.
>I have tried to use ON EXCEPTION, but it only catches sqlcodes < 0.
>I've seeen here, some time ago, that on version 7+ there exists dbinfo(...)
>to get the sqlca.* variables, but as most of my company clients use version 5
>I have to continue to support that version.
Why don't you just use declarative syntax to ensure referential integrity?
Stored procedures and triggers are horribly complicated and smack of
Sybase... :)
Try something like
create table a
(
x int primary key,
y char(30)
);
create table b
(
f serial primary key,
x int references a(x)
);
Or something like that - I don't have a manual handy...
HTH.
>I would also like to know there is any way to use the
>record.* notation when using triggers/stored procedures.
Grrrr. There isn't! :-(
Hasta la vista!
--
billy.wheeler@pixie.co.za