ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Lee Kindness <lkindness@csl.co.uk>
From: Lee Kindness <lkindness@csl.co.uk>
To: PostgreSQL Interfaces <pgsql-interfaces@postgresql.org>
Cc: Lee Kindness <lkindness@csl.co.uk>, Mark Aves <maves@csl.co.uk>, Michael Meskes <meskes@postgresql.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2002-04-25T11:42:00Z
Lists: pgsql-hackers
Assuming the following fetch statement in embedded SQL/C:
EXEC SQL FETCH ALL IN selectFromTable_cur INTO
:array1,
:array2;
is memory automatically allocated (by experimentation I guess so)?
Should the input pointers be NULL initialised? How should the memory
be freed?
Assuming the following fetch statement:
while( 1 )
{
EXEC SQL FETCH 1000 IN selectFromTable_cur INTO
:array1,
:array2;
if( (sqlca.sqlcode < 0) || (sqlca.sqlcode != 0) )
break;
}
is memory automatically allocated (by experimentation I guess so)?
Should the input pointers be NULL initialised before each fetch, or
only before the first one? How should the memory be freed?
Any pointers to useful documentation?
Thanks, Lee Kindness.