Re: EXECUTE INTO on 8.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jon Asher" <jon(dot)asher(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: EXECUTE INTO on 8.2
Date: 2006-12-13 18:58:47
Message-ID: 10395.1166036327@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jon Asher" <jon(dot)asher(at)gmail(dot)com> writes:
> I'm seeing some strange behavior with the following code. It compiles and
> runs but returns an error on the Execute statement:
> List index out of bounds(0)

Worksforme. Want to provide a complete example instead of a fragmentary
one?

regression$# create or replace function foo() returns int as $$
declare srec record;
v_formula varchar;
v_result varchar;
BEGIN
v_formula = 'select 4 as val';
EXECUTE v_formula INTO srec;
return srec.val;
end $$ language plpgsql;
CREATE FUNCTION
regression=# select foo();
foo
-----
4
(1 row)

regression=#

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2006-12-13 19:00:16 Re: MySQL drops support for most distributions
Previous Message Marc Evans 2006-12-13 18:57:13 plperl exception catching