pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Najm Hashmi <najm@mondo-live.com>
To: pgsql <pgsql-sql@postgresql.org>
Subject: ERROR:  parser: parse error at or near "$1"
Date: Mon, 28 May 2001 16:28:29 -0400
Message-ID: <3B12B4ED.50A39965@mondo-live.com> (raw)

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





Message-ID: <3B12B4ED.50A39965@mondo-live.com>
Permalink:  ../3B12B4ED.50A39965@mondo-live.com/
Also on:    postgresql.org/message-id/3B12B4ED.50A39965@mondo-live.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: najm@mondo-live.com
  Subject: Re: ERROR:  parser: parse error at or near "$1"
  In-Reply-To: <3B12B4ED.50A39965@mondo-live.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox