Re: Strange error with Pl/PgSQL
От | Tom Lane |
---|---|
Тема | Re: Strange error with Pl/PgSQL |
Дата | |
Msg-id | 685.975171046@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Strange error with Pl/PgSQL (Laurent HERVE <laurent_herve@infonie.fr>) |
Список | pgsql-novice |
Laurent HERVE <laurent_herve@infonie.fr> writes: > create function TEST (char(5),char(6),char(11)) > returns boolean > as ' > DECLARE > bank alias for $1; > guichet alias for $2; > compte alias for $3; ^^^^^^ > cmpt record; > BEGIN > raise notice ''Banque %'',bank; > select into cmpt * from compte; ^^^^^^ > return ''t''; > END;' > LANGUAGE 'plpgsql'; > ERROR: parser: parse error at or near "$1" > It doesn't happen with another table than ''compte''. You've used compte as the name of a parameter in the function, so the SELECT gets transformed to select into cmpt * from $3; which won't work. (Although I'd have expected the error message to complain about $3 not $1 ... hmm ... maybe something else is going on here?) regards, tom lane
В списке pgsql-novice по дате отправления: