Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL do processing on output cursor ?

Re: PL/SQL do processing on output cursor ?

From: Ka <jackhui_at_hotmail.com>
Date: Sun, 8 Dec 2002 23:26:15 +0800
Message-ID: <asvobg$i1m2@rain.i-cable.com>


Actually, I want to get self-maintained counters, for performance issue, I get a block of counters and allocated to other part of my system per request. Say, I get 100 numbers from 1, then I have to update the row that the counter is 101.

I think totally, I've about 50 counters maintained on my own, totally. At system initializing, I'll get all the counters with this procedure to return a cursor into my program (writing in C#).

"Ka" <jackhui_at_hotmail.com> wrote in message news:asvkef$i1k1_at_rain.i-cable.com...
> I create the following Stored Procedure, but it can't compile. I want to
> return a cursor
> from a "select", but after select, I want to update the fields too. Can I
do
> it ??
>
> PROCEDURE GetTokenControlList(p_cursor OUT refcur) IS
> new_counter NUMBER;
> BEGIN
> OPEN p_cursor FOR
> SELECT TOK_KEY, TOK_COUNTER, TOK_BLOCKSIZE FROM TIF_TOKENCONTROL;
>
> FOR tok_rec in p_cursor LOOP
> new_counter := tok_rec.TOK_COUNTER + tok_rec.TOK_BLOCKSIZE;
> UPDATE TIF_TOKENCONTROL SET TOK_COUNTER = new_counter
> WHERE TOK_KEY = tok_rec.TOK_KEY;
> END LOOP;
>
> END GetTokenControlList;
>
>
Received on Sun Dec 08 2002 - 09:26:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US