I have a cursor that i got from a select statement. I would like to know how many records are in the cursor so i dont go over the last one when using FETCH on the cursor. How can i do this? thanks! -- Alexander Cohen http://www.toomuchspace.com (819) 348-9237 (819) 432-3443
Alexander Cohen <alex@toomuchspace.com> writes:
> I have a cursor that i got from a select statement. I would like to
> know how many records are in the cursor so i dont go over the last one
> when using FETCH on the cursor. How can i do this?
You can't. The system does not know how many rows will be in the query
until it executes it. So the only way to obtain this information is to
FETCH the data. (Or MOVE over it, but that's only marginally faster,
and is probably a dead loss if you intend to FETCH the data anyway
later.)
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера