| From: | "Reinhard Hnat" <hnat(at)logotronic(dot)co(dot)at> |
|---|---|
| To: | <pgsql-novice(at)postgresql(dot)org> |
| Subject: | pl/pgsql Function Problem |
| Date: | 2004-01-28 12:42:04 |
| Message-ID: | 000701c3e59c$3ff44da0$0163a8c0@hnat |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
I have written a pl/pgsql function as follows:
create function aufloesung(varchar,varchar) returns integer as '
declare
tabnam alias for $1;
proj alias for $2;
begin
drop table temptab;
create table $1 as select sum(menge) as menge, bauteilcode, version from
fertigungsprojektliste where fertigungsprojekt=''proj'' group by
bauteilcode,version;
return 1;
end;'
language 'plpgsql';
When I call this function with:
select aufloesung('xyz','0307W2901');
an Error Message is issued: ERROR: 'parser:parse error at or near "$1" at
character 15'
When I change "create table $1" to "create table xyz" the function works
fine. What did I do wrong?
Thanks in advance for your hints.
R.Hnat
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-01-28 15:12:53 | Re: db security; user identification |
| Previous Message | Marcin Gil | 2004-01-28 08:36:37 | Re: db security; user identification |