Search Postgresql Archives

Re: ECPG and Curors.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 12, 2006 at 11:14:24PM -0400, Peter L. Berghold wrote:
> what I don't see is how to detect that I've fetched the last row from a
> query.   Is there more complete doco on this process somewhere?

You could either handle a NOT FOUND exception, or make use of SQLCODE or
SQLSTATE like this...


EXEC SQL DECLARE csr_fred CURSOR FOR SELECT....

EXEC SQL OPEN csr_fred;

while (SQLCODE == 0) {
	EXEC SQL FETCH csr_fred INTO :jim, :sheila,...

	if (SQLCODE == 0) {

		....
		body of row processing here
		....
	}
}

EXEC SQL CLOSE csr_fred;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux