Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clear a ref_cursor in oracle
Message
From
03/05/2004 16:09:14
John Baird
Coatesville, Pennsylvania, United States
 
 
To
03/05/2004 16:01:17
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00900481
Message ID:
00900496
Views:
9
found this after a quick search. Looks like you just CLOSE curName....
/*
** This block does some numeric processing on data that
** comes from experiment #1.  The results are stored in
** the TEMP table.
**
** Copyright (c) 1989,1992 Oracle Corporation
*/

DECLARE
    num1    data_table.n1%TYPE;   -- Declare variables
    num2    data_table.n2%TYPE;   -- to be of same type as
    num3    data_table.n3%TYPE;   -- database columns
    result  temp.num_col1%TYPE;
    CURSOR c1 IS
        SELECT n1, n2, n3 FROM data_table
            WHERE exper_num = 1;
BEGIN
    OPEN c1;
    LOOP
        FETCH c1 INTO num1, num2, num3;
        EXIT WHEN c1%NOTFOUND;
            -- the c1%NOTFOUND condition evaluates
            -- to TRUE when FETCH finds no more rows
        /* calculate and store the results */
        result := num2/(num1 + num3);
        INSERT INTO temp VALUES (result, NULL, NULL);
    END LOOP;
    CLOSE c1;
    COMMIT;
END;
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform