Cursor.Recordcount

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Feb 2 09:30:39 CST 2009


On 2/2/09 2:35 PM, "Bart Pietercil" <bart.pietercil at cognosis.be> wrote:

>>> that is what I mean. Is this because doing a curs.recordcount (in the
>>> api) equals doing the select count(....) ?
>>> So there is nothing to gain ? There is no cursor property that
>>> already
>>> has the cursorcount ?
>> 
>> For SPs no such property.
>> 
>> I have not catch what problem with that exception?
>> 
>> It is normal to get cursor and try do fetch
>> If empty cursor then record will not be fetched
> 
> By itself not really a problem (I can catch this by doing a select
> count()...)
> The problem is that in my sp I have let's say 4 places where I need to
> build a cursor that will be looped
> 
> create sp
> 
> begin
> 
> 1) makecursor
> open cursor
> firstrecord
> loop
> ...
> end loop
> 
> 2) makecursor
> open cursor
> firstrecord
> loop
> ...
> end loop
> 
> 3) makecursor
> open cursor
> firstrecord
> loop
> ...
> end loop
> 
>   4) makecursor
> open cursor
> firstrecord
> loop
> ...
> end loop
> 
> exception
>   when 56503 then.....
> end
> 
> 
> ---------
> 
> 
> now if firstrecord in 1) has an empty cursor the proc will jump to the
> exception while I still want 2,3,4 being executed
> So the lesson is this: only open 1 cursor within a begin end block, or
> prevent the exception from  happening by doing a curs.recordcount .
> Doing a recordcount before building the cursor implies doing the
> select 2 times.

Ivan say that it is possible define BLOCK begin end
    around each group to catch its own exception.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list