Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread FETCH ABSOLUTE <integer>
Sat, Mar 24 2012 3:36 PMPermanent Link

Tiago Ameller

Menorca Zeros i Uns SL

Avatar

I need to randomly get some rows from a cursor. FETCH ABSOLUTE would be the key to avoid more complicated ways. But, it seems only works with constant offsets!

DECLARE PREMIO_ INTEGER;
...
SET PREMIO_ = RAND(_PREMIOS)+1;
FETCH ABSOLUTE PREMIO_ FROM CURSOR_ ('ID') INTO TARJETA_;

ElevateDB Error #700 An error was found in the statement at line 31 and column 25 (Expected constant value expression but instead found "PREMIO_")

Will be possible using any integer value?

Thanks!
Mon, Mar 26 2012 12:55 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Tiago,

<< I need to randomly get some rows from a cursor. FETCH ABSOLUTE would be
the key to avoid more complicated ways. But, it seems only works with
constant offsets! >>

Sure, I can add that in the next build.

--
Tim Young
Elevate Software
www.elevatesoft.com
Mon, Mar 26 2012 12:59 PMPermanent Link

Tiago Ameller

Menorca Zeros i Uns SL

Avatar

Tim,

<<Sure, I can add that in the next build.>>
Thanks, Tim. I guess you also'll do this for RELATIVE clause Wink

--
Tim Young
Elevate Software
www.elevatesoft.com
Image