Delete function
Started by Secrétariatover 21 years ago2 messagesgeneral
Hello !
I create a delete function :
CREATE FUNCTION delalpha(varchar, integer) RETURNS boolean
AS 'DELETE FROM public.params WHERE soc = $1 AND numpar = $2 ;
SELECT TRUE ;'
LANGUAGE sql ;
Is there a way to return the number of deleted row ?
Thanks.
Luc
Re: Delete function
Secr�tariat wrote:
Hello !
I create a delete function :
CREATE FUNCTION delalpha(varchar, integer) RETURNS boolean
AS 'DELETE FROM public.params WHERE soc = $1 AND numpar = $2 ;
SELECT TRUE ;'
LANGUAGE sql ;
Is there a way to return the number of deleted row ?
Thanks.
If you rewrote the function in plpgsql, you could use "GET DIAGNOSTICS"
- see the manual plpgsql/Obtaining the result status.
--
Richard Huxton
Archonet Ltd