SQL> CREATE TABLE COMPANY ( 
  2    SNO            CHAR (12)     NOT NULL, 
  3    CMEMO          CLOB, 
  4    CONSTRAINT PK_COMPANY_1__13
  5    PRIMARY KEY ( SNO ) )
  6  ; 表已创建。SQL> create materialized view company
  2  on prebuilt table with reduced precision
  3  refresh force
  4  start with sysdate next trunc(sysdate+1)+21/24
  5  with primary key
  6  as
  7  select SNO,TO_LOB(CMEMO)from scgd.company@REMOTE_CONNECT;
select SNO,TO_LOB(CMEMO)from scgd.company@REMOTE_CONNECT
                                  *
ERROR 位于第 7 行:
ORA-00997: 非法使用 LONG 数据类型

解决方案 »

  1.   

    上网查就说TO_LOB函数啊   咋回事儿呢
      

  2.   

    特殊的to_lob函数
    只能用在insert into.. select 或create table as select ..的子查询中
    不能用在select 和update
    http://download.oracle.com/docs/ ... 00/functions185.htmSQL> update d set dummy=null where 1=0 and dummy in(select to_lob(COLUMN_EXPRESSION) from user_ind_expressions);
    update d set dummy=null where 1=0 and dummy in(select to_lob(COLUMN_EXPRESSION) from user_ind_expressions)
                                                          *
    ERROR 位于第 1 行:
    ORA-00932: 不一致的数据类型: 要求 - 得到的却是 LONG
    已用时间:  00: 00: 00.00
    SQL> insert into d select to_lob(COLUMN_EXPRESSION) from user_ind_expressions;已创建4行。已用时间:  00: 00: 00.00
    SQL> create table d1 as select to_lob(COLUMN_EXPRESSION)d from user_ind_expressions;表已创建。