Re: Calling SQL functions from ECPG

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Owens, Steve" <Steve(dot)Owens(at)usa(dot)xerox(dot)com>
Cc: "Pgsql-Interfaces (E-mail)" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Calling SQL functions from ECPG
Date: 2004-04-21 03:50:06
Message-ID: 25615.1082519406@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

"Owens, Steve" <Steve(dot)Owens(at)usa(dot)xerox(dot)com> writes:
> EXEC SQL SELECT get_foo(1) INTO :record;

> I get a "ERROR: Cannot display record of type RECORD at line 26".

I know zip about ECPG, but I'd think a more likely bet is

EXEC SQL SELECT * INTO :record FROM get_foo(1);
or
EXEC SQL SELECT * FROM get_foo(1) INTO :record;

depending on what your theology is about the placement of INTO. The
point is that a function returning setof-record is a table source and
should appear in FROM.

regards, tom lane

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message bcsaba 2004-04-21 05:57:04 BLIBPQ.LIB, BLIBPQDLL.LIB or LIBPQ 7.4 problem
Previous Message Bruce Momjian 2004-04-20 23:48:27 Re: Everything broke