Re: [SQL] handling error in a function

2002-12-18 Thread Tomasz Myrta
Peter Gabriel wrote: When executing this and violating that constraint (i mustn't delete that row), the function aborts with "unknown error" and i have no way to return 0 or something like that. I am programming with PHP and PEAR, each time, the result set is an object of type error, the scrip

Re: [SQL] handling error in a function

2002-12-18 Thread Christoph Haller
> > i made desperate efforts with handling errors in a function. > > I am using functions for encapsulating a few sql-statements. Please have a > look at this: > > CREATE FUNCTION sp_fdelce(int4) RETURNS int4 AS ' > DECLARE > id ALIAS FOR $1; > BEGIN >DELETE FROM f_ces WHERE fce_id = id; >

[SQL] handling error in a function

2002-12-17 Thread Peter Gabriel
Hi all! i made desperate efforts with handling errors in a function. I am using functions for encapsulating a few sql-statements. Please have a look at this: CREATE FUNCTION sp_fdelce(int4) RETURNS int4 AS ' DECLARE id ALIAS FOR $1; BEGIN DELETE FROM f_ces WHERE fce_id = id; -- "v