because the expansion of your view exceeed 4,000 characters. Not going to happen with SQL then.
using my word_wrap routine, and a bit of plsql, we can print it out.
I created a nasty view:
ops$tkyte@ORA9IR2> set long 500
ops$tkyte@ORA9IR2> select text from user_views where view_name = 'V';
TEXT
-------------------------------------------------------------------------------
select 1 id,1"C00000000000000000000000000001",1"C00000000000000000000000000002"
,1"C00000000000000000000000000003",1"C00000000000000000000000000004",1"C0000000
0000000000000000000005",1"C00000000000000000000000000006",1"C000000000000000000
00000000007",1"C00000000000000000000000000008",1"C00000000000000000000000000009
",1"C00000000000000000000000000010",1"C00000000000000000000000000011",1"C000000
00000000000000000000012",1"C00000000000000000000000000013",1"C00000000000000000
000000000014",1"C000000000
(the columns are mashed together, 74 of them, really long...)
set long 500000
declare
l_clob long;
procedure word_wrap( p_string in varchar2, p_len in number default 65 )
as
l_string long default replace( p_string || chr(10), chr(9), ' ' );
l_result long default NULL;
l_piece long;
l_ws varchar2(25) default ' ' || chr(9);
l_sep varchar2(5) default NULL;
n number;
begin
loop
exit when l_string is NULL;
n := instr( l_string, chr(10) );
l_piece := substr( l_string, 1, n-1 );
l_string := substr( l_string, n+1 );
loop
exit when l_piece is NULL;
n := length(l_piece);
if ( n > p_len ) then
n := instr( substr(
translate(l_piece,l_ws,rpad(' ',length(l_ws))),
1, p_len ), ' ', -1);
if ( nvl(n,0) = 0 ) then
n := p_len;
end if;
end if;
dbms_output.put_line( substr( l_piece, 1, n ) );
l_piece := substr( l_piece, n+1 );
end loop;
end loop;
end;
begin
l_clob := dbms_lob.substr( dbms_metadata.get_ddl( 'VIEW', 'V' ), 32760, 1 );
l_clob := replace( l_clob, ',', ', ' );
word_wrap( l_clob );
end;
/
prints it out:
CREATE OR REPLACE FORCE VIEW "OPS$TKYTE"."V" ("ID",
"C00000000000000000000000000001",
"C00000000000000000000000000002",
"C00000000000000000000000000003",
"C00000000000000000000000000004",
"C00000000000000000000000000005",
"C00000000000000000000000000006",
"C00000000000000000000000000007",
"C00000000000000000000000000008",
"C00000000000000000000000000009",
"C00000000000000000000000000010",
"C00000000000000000000000000011",
"C00000000000000000000000000012",
"C00000000000000000000000000013",
"C00000000000000000000000000014",
"C00000000000000000000000000015",
"C00000000000000000000000000016",
"C00000000000000000000000000017",
"C00000000000000000000000000018",
"C00000000000000000000000000019",
"C00000000000000000000000000020",
"C00000000000000000000000000021",
"C00000000000000000000000000022",
"C00000000000000000000000000023",
"C00000000000000000000000000024",
"C00000000000000000000000000025",
"C00000000000000000000000000026",
"C00000000000000000000000000027",
"C00000000000000000000000000028",
"C00000000000000000000000000029",
"C00000000000000000000000000030",
"C00000000000000000000000000031",
"C00000000000000000000000000032",
"C00000000000000000000000000033",
"C00000000000000000000000000034",
"C00000000000000000000000000035",
"C00000000000000000000000000036",
"C00000000000000000000000000037",
"C00000000000000000000000000038",
"C00000000000000000000000000039",
"C00000000000000000000000000040",
"C00000000000000000000000000041",
"C00000000000000000000000000042",
"C00000000000000000000000000043",
"C00000000000000000000000000044",
"C00000000000000000000000000045",
"C00000000000000000000000000046",
"C00000000000000000000000000047",
"C00000000000000000000000000048",
"C00000000000000000000000000049",
"C00000000000000000000000000050",
"C00000000000000000000000000051",
"C00000000000000000000000000052",
"C00000000000000000000000000053",
"C00000000000000000000000000054",
"C00000000000000000000000000055",
"C00000000000000000000000000056",
"C00000000000000000000000000057",
"C00000000000000000000000000058",
"C00000000000000000000000000059",
"C00000000000000000000000000060",
"C00000000000000000000000000061",
"C00000000000000000000000000062",
"C00000000000000000000000000063",
"C00000000000000000000000000064",
"C00000000000000000000000000065",
"C00000000000000000000000000066",
"C00000000000000000000000000067",
"C00000000000000000000000000068",
"C00000000000000000000000000069",
"C00000000000000000000000000070",
"C00000000000000000000000000071",
"C00000000000000000000000000072",
"C00000000000000000000000000073",
"C00000000000000000000000000074") AS
select 1 id, 1"C00000000000000000000000000001",
1"C00000000000000000000000000002",
1"C00000000000000000000000000003",
1"C00000000000000000000000000004",
1"C00000000000000000000000000005",
1"C00000000000000000000000000006",
1"C00000000000000000000000000007",
1"C00000000000000000000000000008",
1"C00000000000000000000000000009",
1"C00000000000000000000000000010",
1"C00000000000000000000000000011",
1"C00000000000000000000000000012",
1"C00000000000000000000000000013",
1"C00000000000000000000000000014",
1"C00000000000000000000000000015",
1"C00000000000000000000000000016",
1"C00000000000000000000000000017",
1"C00000000000000000000000000018",
1"C00000000000000000000000000019",
1"C00000000000000000000000000020",
1"C00000000000000000000000000021",
1"C00000000000000000000000000022",
1"C00000000000000000000000000023",
1"C00000000000000000000000000024",
1"C00000000000000000000000000025",
1"C00000000000000000000000000026",
1"C00000000000000000000000000027",
1"C00000000000000000000000000028",
1"C00000000000000000000000000029",
1"C00000000000000000000000000030",
1"C00000000000000000000000000031",
1"C00000000000000000000000000032",
1"C00000000000000000000000000033",
1"C00000000000000000000000000034",
1"C00000000000000000000000000035",
1"C00000000000000000000000000036",
1"C00000000000000000000000000037",
1"C00000000000000000000000000038",
1"C00000000000000000000000000039",
1"C00000000000000000000000000040",
1"C00000000000000000000000000041",
1"C00000000000000000000000000042",
1"C00000000000000000000000000043",
1"C00000000000000000000000000044",
1"C00000000000000000000000000045",
1"C00000000000000000000000000046",
1"C00000000000000000000000000047",
1"C00000000000000000000000000048",
1"C00000000000000000000000000049",
1"C00000000000000000000000000050",
1"C00000000000000000000000000051",
1"C00000000000000000000000000052",
1"C00000000000000000000000000053",
1"C00000000000000000000000000054",
1"C00000000000000000000000000055",
1"C00000000000000000000000000056",
1"C00000000000000000000000000057",
1"C00000000000000000000000000058",
1"C00000000000000000000000000059",
1"C00000000000000000000000000060",
1"C00000000000000000000000000061",
1"C00000000000000000000000000062",
1"C00000000000000000000000000063",
1"C00000000000000000000000000064",
1"C00000000000000000000000000065",
1"C00000000000000000000000000066",
1"C00000000000000000000000000067",
1"C00000000000000000000000000068",
1"C00000000000000000000000000069",
1"C00000000000000000000000000070",
1"C00000000000000000000000000071",
1"C00000000000000000000000000072",
1"C00000000000000000000000000073",
1"C00000000000000000000000000074" from dual
PL/SQL procedure successfully completed.
ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2>
<b>add a set feedback off, set echo off, add a dbms_output.put_line( '/' ); add a set serveroutput on size 1000000 and there you go.</b>