Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    42

    Unanswered: stored procedure

    Hi,

    using stored procedures how do we retrieve values from database and return the results as a cursor.

  2. #2
    Join Date
    Dec 2003
    Posts
    74
    here is an example
    ------------------------------------------
    declare
    cursor c_cursor is
    -- Put your select statement here
    select
    column1,
    column2
    from
    table_name


    BEGIN

    FOR r_cursor IN c_cursor
    LOOP
    --DO WHAT YOU WILL WITH YOU DATA RETURNED FROM YOUR CURSOR HERE
    E.G.
    display r_cursor.column1
    display r_cursor.column2
    EXIT WHEN c_cursor%NOTFOUND;
    END LOOP;
    END;
    ------------------------------------------
    HOPE THIS HELPS

    ED

Posting Permissions

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