From: | Najm Hashmi <najm(at)mondo-live(dot)com> |
---|---|
To: | pgsql <pgsql-sql(at)postgresql(dot)org> |
Subject: | ERROR: parser: parse error at or near "$1" |
Date: | 2001-05-28 20:28:29 |
Message-ID: | 3B12B4ED.50A39965@mondo-live.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Tim Barnard | 2001-05-28 22:36:22 | Re: [SQL] Difficult SQL Statement |
Previous Message | Tim Barnard | 2001-05-28 19:13:48 | Re: [SQL] Very big problem |