ECPG: FETCH ALL|n FROM cursor - Memory allocation? - Mailing list pgsql-interfaces

From Lee Kindness
Subject ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Date
Msg-id 15559.60296.332310.657745@kelvin.csl.co.uk
Whole thread Raw
Responses Re: ECPG: FETCH ALL|n FROM cursor - Memory allocation?  (Michael Meskes <meskes@postgresql.org>)
List pgsql-interfaces
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.


pgsql-interfaces by date:

Previous
From: "Marc Zandvliet"
Date:
Subject: help with integrating liblpq program
Next
From: Michael Meskes
Date:
Subject: Re: ECPG: FETCH ALL|n FROM cursor - Memory allocation?