Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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);
	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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group