Results 1 to 6 of 6

Thread: %rowtype

  1. #1
    Join Date
    Aug 2002
    Posts
    121

    Question Unanswered: %rowtype

    Is there a way to print the contents of a %ROWTYPE variable to the screen? I tried...

    TEXT_IO.PUT_LINE(TO_CHAR(v_dept))

    but it gives a "too many arguments error"

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Specify all "parts" of this variable separately. For example:
    Code:
    SQL> set serveroutput on
    SQL> l
      1  declare
      2    cursor c1 is select empno, ename from emp;
      3    c1r c1%rowtype;
      4  begin
      5    open c1;
      6    loop
      7      fetch c1 into c1r;
      8      exit when c1%notfound;
      9
     10      dbms_output.put_line(c1r.empno ||' '|| c1r.ename);
     11    end loop;
     12* end;
    SQL> /
    7369 SMITH
    7499 ALLEN
    7521 WARD
    7566 JONES
    7654 MARTIN
    7698 BLAKE
    7782 CLARK
    7839 KING
    7844 TURNER
    7900 JAMES
    7902 FORD
    7934 MILLER
    
    PL/SQL procedure successfully completed.
    
    SQL>

  3. #3
    Join Date
    Aug 2002
    Posts
    121

    Talking %rowtype

    That what i suspected but I wasn't sure...

    Thanks
    TM

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    How do you explain the fact that you suspected that this might be the solution, but never actually tried it? Doing so really doesn't cost much ...

  5. #5
    Join Date
    Aug 2002
    Posts
    121

    %rowtype

    I guess with any problem, one entertains several possible solutions. I thought I'd bounce the question off this board before I went on a fishing trip.

  6. #6
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    212
    did you catch something? :-)

Posting Permissions

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