Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> how to cast dbms_output.chararr type to table

how to cast dbms_output.chararr type to table

From: <streib_at_cs.indiana.edu>
Date: 2 May 2006 04:38:52 -0700
Message-ID: <1146569932.861338.7480@i39g2000cwa.googlegroups.com>


Is it possible?

I tried:

> create type o_line as object(line varchar2(255));
  2 /

Type created.

> create type o_lines as table of o_line;
  2 /

Type created.

> create table a1 (a varchar2(255));

Table created.

begin

    dbms_output.enable;
    dbms_output.put_line('Line 1');
    dbms_output.put_line('Line 2');
    dbms_output.put_line('Line 3');
    dbms_output.put_line('Line 4');
    dbms_output.put_line('Line 5');

end;
/

PL/SQL procedure successfully completed.

declare

    outlines DBMS_OUTPUT.CHARARR;
    numlines pls_integer := 100;
begin

    dbms_output.get_lines(outlines, numlines);     insert into a1 (a)
    select line from table(cast(outlines as o_lines)); end;
/

ERROR at line 7:
ORA-06550: line 7, column 33:
PLS-00382: expression is of wrong type Received on Tue May 02 2006 - 06:38:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US