EXECUTE INTO on 8.2

From: "Jon Asher" <jon(dot)asher(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: EXECUTE INTO on 8.2
Date: 2006-12-13 18:36:41
Message-ID: d24c7af0612131036r51e02751rb45bdc52ae95188b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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)

DECLARE
srec record;
v_formula varchar;
v_result varchar;

BEGIN
v_formula = 'select 4 as val';
EXECUTE v_formula INTO srec;
END;

However, the old school version runs w/no problem:

BEGIN
v_formula = 'select 4 as val';

FOR srec IN EXECUTE v_formula LOOP
v_result = srec.val;
END LOOP;
END;

Any idea why the new syntax isn't working? (I'm running 8.2 on a Windows
dev box.)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2006-12-13 18:37:05 Re: MySQL drops support for most distributions
Previous Message Tom Lane 2006-12-13 18:35:24 Re: Pltcl error - could not create "normal" interpreter