Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 47AC6475CC4 for ; Tue, 3 Dec 2002 07:52:17 -0500 (EST) Received: from server45.aip.com.br (unknown [200.199.192.5]) by postgresql.org (Postfix) with ESMTP id 98F72475A3F for ; Tue, 3 Dec 2002 07:52:15 -0500 (EST) Received: from PEDRO ([10.1.0.11]) by server45.aip.com.br with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id X40SXNSD; Tue, 3 Dec 2002 10:54:08 -0300 Message-ID: <001001c29ac9$8f8de3e0$0b00010a@aip.com.br> From: "Pedro Igor" To: Subject: SQL QUERY Date: Tue, 3 Dec 2002 10:43:19 -0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C29AB8.CB73D060" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/25 X-Sequence-Number: 10613 This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C29AB8.CB73D060 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have the following function: CREATE FUNCTION public.auto_incremento() RETURNS trigger AS ' begin new.id =3D (select (max(id) + 1) from teste); return new; end;' LANGUAGE 'plpgsql'=20 I created a trigger that uses this function, but i want to the function be = usefull for all tables and not only to tbale teste. Someone know how ??? Pedro Igor ------=_NextPart_000_000D_01C29AB8.CB73D060 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I have the following function:

CREATE FUNCTION public.auto_incremento() RETURNS=20 trigger = AS '
begin
new.id =3D = (
select (max(id) + 1) = from teste);
return new;<= BR>end;'=20
LANGUAGE 'plpgs= ql'=20

I created a trigger that uses this function,= but i=20 want to the function be usefull for all tables and not only to tbale=20 teste.

Someone know how ???

 

Pedro Igor

 

------=_NextPart_000_000D_01C29AB8.CB73D060--