Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    18

    Unanswered: Output records without specifying list field names

    Hi,

    Below is the SQL to output a field of a variable table name.

    Anyone know how to output the entire record without specifying the list field names? Need your advise. Thanks.

    FOR siWO_rec IN curSI_WO LOOP
    sql_stmt := 'SELECT * FROM ' || siWO_rec.TABLENAME;
    OPEN si_cv FOR sql_stmt;
    LOOP
    FETCH si_cv INTO si_rec;
    EXIT WHEN si_cv%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(si_rec.FIELD1);
    END LOOP;
    CLOSE si_cv;
    END LOOP;

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Output records without specifying list field names

    You can't do it this way without using the field names. However, if you use the DBMS_SQL package you don't need to know the field names: you can extract the column values one at a time into a variable and output them.

Posting Permissions

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