Search Postgresql Archives

Re: EXECUTE INTO on 8.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Jon Asher" <jon.asher@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux