ERROR: parser: parse error at or near "$1"

Поиск
Список
Период
Сортировка
От Najm Hashmi
Тема ERROR: parser: parse error at or near "$1"
Дата
Msg-id 3B12B4ED.50A39965@mondo-live.com
обсуждение исходный текст
Список 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
loopFOR 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




В списке pgsql-sql по дате отправления:

Предыдущее
От: Martín Marqués
Дата:
Сообщение: Re: Seq Scan
Следующее
От: tolik@aaanet.ru (Anatoly K. Lasareff)
Дата:
Сообщение: Re: Select for LEFT JOIN