This is a discussion on Re: plpgsql within the pgsql Novice forums, part of the PostgreSQL category; --> >>Am I missing anything or is >>record assignment not possible in plpgsql? > > > Your example works fine ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| >>Am I missing anything or is >>record assignment not possible in plpgsql? > > > Your example works fine for me in PG 8.0. There were some improvements > in this area since 7.*, though I'm not sure offhand whether they were > material to this particular case. strange. laik is the table with rows nr integer and txt varchar. CREATE OR REPLACE FUNCTION tst1(integer) RETURNS laik AS ' SELECT * FROM laik where nr=$1; ' LANGUAGE 'sql'; CREATE OR REPLACE FUNCTION tst2(integer) RETURNS varchar AS ' DECLARE v laik; BEGIN v := tst1($1); RETURN 1; END; ' LANGUAGE 'plpgsql' VOLATILE; if i try to 'select tst2(1);' I get the following error message: ERROR: syntax error at or near "v" CONTEXT: compile of PL/pgSQL function "tst2" near line 4 I'm using Postgresql 7.4.3. Will try this with 8, but even if it works with 8, it's not good - I don't know on what version of postgre my db will later reside. Thanks, dim ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend |