how to use CURSOR in DBMS_SQL???
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: how to use CURSOR in DBMS_SQL???

  1. #1
    Join Date
    Feb 2003
    Posts
    2

    Unhappy how to use CURSOR in DBMS_SQL???

    CREATE OR REPLACE PROCEDURE CreateTable(
    p_Description IN VARCHAR2
    )IS
    v_CURSOR NUMBER;
    v_CreateString VARCHAR2(100);
    v_NumRows INTEGER;
    BEGIN
    v_Cursor := DBMS_SQL.OPEN_CURSOR;
    v_CreateString := 'CREATE TABLE temp_table'||p_Description;
    DBMS_SQL.PARSE(v_CURSOR,v_CreateString,DBMS_SQL.V7);
    v_NumRows := DBMS_SQL.EXECUTE(v_Cursor);
    DBMS_SQL.CLOSE_CURSOR(v_Cursor);

    END;

    Q1:What's mean of v_Cursor?how to define it?
    Q2:what's value v_NumRows will get?
    Q3:How to use loop by v_Cursor???

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    You need to see the DBMS_SQL documentation urgently.
    See http://download-west.oracle.com/docs...sql.htm#998100

    Q1:DBMS_SQL cursor is just a number, pointer to a data structure
    Q2:In case DDL (which the CREATE TABLE command is), the return value of the EXECUTE function should be ignored
    Q3:For the example given, using loop makes no sense, the DDL commands don't return rows. For queries returning rows (SELECT ...) use the FETCH_ROWS function.
    Ales
    The whole difference between a little boy and an adult man is the price of toys

  3. #3
    Join Date
    Feb 2003
    Posts
    2

    Thanks for you!

    http://download-west.oracle.com
    is a good site! i have learn something from it !
    thank you!

Posting Permissions

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



Click Here to Expand Forum to Full Width