-- 处理 LONG 数据的方法:Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 Connected as test@MSGDESQL> SQL> create view myview as select sysdate s from dual ; View created SQL> create view v1 as select 1 rn from dual ; View created SQL> create table myviews 2 as 3 select view_name, to_lob(text) text from user_views ; Table created SQL> select view_name, to_char(text) view_ddl from myviews ; VIEW_NAME VIEW_DDL ------------------------------ ------------------------------ MYVIEW select sysdate s from dual V1 select 1 rn from dual SQL> drop view myview ; View dropped SQL> drop view v1 ; View dropped SQL> drop table myviews purge ; Table droppedSQL>
-- 处理 LONG 数据的方法:Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.2.0
Connected as test@MSGDESQL>
SQL> create view myview as select sysdate s from dual ;
View created
SQL> create view v1 as select 1 rn from dual ;
View created
SQL> create table myviews
2 as
3 select view_name, to_lob(text) text from user_views ;
Table created
SQL> select view_name, to_char(text) view_ddl from myviews ;
VIEW_NAME VIEW_DDL
------------------------------ ------------------------------
MYVIEW select sysdate s from dual
V1 select 1 rn from dual
SQL> drop view myview ;
View dropped
SQL> drop view v1 ;
View dropped
SQL> drop table myviews purge ;
Table droppedSQL>
用TO_LOB可以取出来的。
但是又有另外一个问题。当遇到只读用户的时候。无法创建临时表。
我用PLSQL块会报错,用DB_LINK也不支持LOB。想在另外一个用户把USER_VIEWS拿过去也做不到。