Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 605AF475D00 for ; Mon, 7 Oct 2002 22:14:11 -0400 (EDT) Received: from mail019.syd.optusnet.com.au (mail019.syd.optusnet.com.au [210.49.20.160]) by postgresql.org (Postfix) with ESMTP id EBA99475B8A for ; Mon, 7 Oct 2002 22:14:06 -0400 (EDT) Received: from webmail05.syd.optusnet.com.au (webmail05.syd.optusnet.com.au [210.49.20.116]) by mail019.syd.optusnet.com.au (8.11.1/8.11.1) with ESMTP id g982EAt24326 for ; Tue, 8 Oct 2002 12:14:10 +1000 Message-Id: <200210080214.g982EAt24326@mail019.syd.optusnet.com.au> Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.411 (Entity 5.404) Received: from [198.142.67.192] as user gordoncl@optusnet.com.au by webmail.optusnet.com.au with HTTP; From: gordoncl@optusnet.com.au To: pgsql-sql@postgresql.org Date: Tue, 08 Oct 2002 12:14:10 +1000 Subject: Probs "compiling" a function X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/101 X-Sequence-Number: 9819 Greetings, Having probs just "compiling" this fn and it comes back with a very stark error msg which is below. I'm using version 7.1.3 I run the script as: \i procedures/zff and get the error msg: psql:procedures/zff:51: ERROR: parser: parse error at or near "b" Line 51 is the line that starts LANGUAGE.... And the script is: CREATE FUNCTION bsub_insert(varchar,varchar,varchar,varchar,varchar, varchar,varchar,varchar,varchar,varchar,bool,date,int2,int4,varchar,int4) RETURNS integer AS ' DECLARE tmp_bsub RECORD; t_sub_id2 INTEGER; t_class_sun INTEGER; p_band_nm ALIAS FOR $1; BEGIN IF p_band_nm IS NULL THEN RETURN 0; END IF; IF $3 IS NULL THEN RETURN 0; END IF; IF $4 IS NULL THEN RETURN 0; END IF; IF $11 IS NULL THEN RETURN 0; END IF; IF $12 IS NULL THEN RETURN 0; END IF; IF $15 IS NULL THEN RETURN 0; END IF; SELECT INTO tmp_bsub * FROM sub_class WHERE sub_class.class_ds = upper($15); IF NOT FOUND THEN RETURN -1; END IF; t_class_sun := tmp_bsub.class_sun; INSERT INTO sub(band_commnty_nm,street_no,first_nm,surname,home_phone_no, work_phone_no,mobile_phone_no,email_tx,web_addr_tx,sub_comment, voluntr_fl,sub_expiry_dt,card_cnt,receipt_no,sub_type_ind, class_sun,street_sun) VALUES(upper($1),$2,upper($3),upper($4),$5,$6,$7,$8,$9,upper($10),$11, $12,$13,$14,/'B/',t_class_sun,$16); GET DIAGNOSTICS t_sub_id2 = RESULT_OID; SELECT INTO tmp_bsub * FROM sub WHERE oid = t_sub_id2; RETURN tmp_bsub.sub_no; END; ' LANGUAGE 'plpgsql'; Thanks for any help as this is driving me made and I've rewritten it checked all the b's and compared it to other fns I've written and nothing I'm using here I haven't already used. Cheers...Gordon