Received: from lin.local.lan ([216.221.221.2]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4SKScA47018 for ; Mon, 28 May 2001 16:28:38 -0400 (EDT) (envelope-from najm@mondo-live.com) Received: from mondo-live.com (IDENT:najm@najm.local2.lan [192.168.2.20]) by lin.local.lan (8.9.3/8.8.7) with ESMTP id VAA16431 for ; Mon, 28 May 2001 21:02:15 GMT Message-ID: <3B12B4ED.50A39965@mondo-live.com> Date: Mon, 28 May 2001 16:28:29 -0400 From: Najm Hashmi X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql Subject: ERROR: parser: parse error at or near "$1" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200105/304 X-Sequence-Number: 3145 HI all, I am getting this weird syntax error i.e. parse error at or near "$1" and I am not even passing any arguement to my pl/pgsql function. Here is my function , please someone could elobarte before I go nuts :) drop function populate_art_details(); create function populate_art_details() returns bool as' declare lab record; art record; coll_ids text; lab_ids text; del text; begin del:=''|''; lab_ids:=''''; coll_ids:=''''; FOR art IN select r.artist_id,r.crh_id,r.coll_id,r.label_id, a.name,a.extrinfo from artist a, releases r where r.artist_id=a.artist_id loop FOR lab IN SELECT coll_id,label_id from releases where artist_id = art.artist_id loop coll_ids:=coll_ids||del||lab.coll_id; lab_ids:=lab_ids||del||lab.label_id; end loop; coll_ids:=coll_ids||del; lab_ids:=lab_ids||del; insert into artist_details( artist_id,crh_id,labels_id, coll_ids,name,info) values (art.artist_id,art.crh_id,lab_ids,coll_ids,art.name,art.extrinfo); end loop; return ''t''; end; ' language 'plpgsql'; select populate_art_details(); Regards, -- Najm Hashmi Tel:514-271-9791 www.mondo-live.com www.flipr.com