Received: from digitalplanit.wdi.co.uk (root@[195.13.87.250]) by hub.org (8.10.1/8.10.1) with ESMTP id e7ICQBm55288 for ; Fri, 18 Aug 2000 08:26:12 -0400 (EDT) Received: from Graham (th-access1-105.gw.cerbernet.net [195.13.86.105]) by digitalplanit.wdi.co.uk (8.9.3/8.9.3) with SMTP id NAA17935 for ; Fri, 18 Aug 2000 13:30:17 GMT From: "Graham Vickrage" To: Subject: sequences in functions Date: Fri, 18 Aug 2000 13:24:15 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Importance: Normal X-Archive-Number: 200008/174 I am having problems referencing sequeces in a function, I think because of the '' characters. The function I am creating is a follows: - CREATE FUNCTION InsertClient ( varchar, varchar, varchar, varchar, varchar, varchar ) RETURNS int4 AS ' DECLARE id INT; BEGIN SELECT nextval('client_seq') INTO id; INSERT INTO client (client_id, last_name, address1, country) VALUES (id, $1, $2, $3); INSERT INTO client_card (client_card_id, type, number, expiry_date, client_id) VALUES (nextval('client_card_seq'), $4, $5, $6, id); RETURN id; END; ' LANGUAGE 'plpgsql'; And the error message is ERROR: parser: parse error at or near "client_seq" EOF Is this because of the ' ' ??? Also can you pass in a array or hash to the function? Cheers Graham