Professional Web Applications Themes

PL/SQL do processing on output cursor ? - Oracle Server

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;...

  1. #1

    Default PL/SQL do processing on output cursor ?

    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;


    Ka Guest

  2. #2

    Default Re: PL/SQL do processing on output cursor ?

    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" <jackhuihotmail.com> wrote in message
    news:asvkef$i1k1rain.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;
    >
    >

    Ka Guest

Similar Threads

  1. libxml SAX processing?
    By Grant Goodale in forum Ruby
    Replies: 0
    Last Post: October 14th, 08:35 AM
  2. Replies: 1
    Last Post: October 10th, 06:11 PM
  3. Replies: 0
    Last Post: August 20th, 01:39 AM
  4. cursor 200-problem on mac but not pc? how to swap cursor image?
    By nickelsock webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 5
    Last Post: August 2nd, 10:58 AM
  5. Change the "web hand" cursor in normal arrow cursor?
    By FB1976 in forum Adobe Dreamweaver & Contribute
    Replies: 1
    Last Post: July 9th, 07:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139