insert into news(CONTENT,NEWSID) select MSGTXT,Id from new_rep;据说好像没有问题的阿,你这里面的news是干什么用的?

解决方案 »

  1.   

    是的啊,要是一个表里有LONG类型的数据怎么去备份啊!!
    create table NEW_TABLE AS
    SELECT * FROM OLD_TABLE
    不行啊!!!
      

  2.   

    看一下Oracle9i2的手册,一下是使用Long类型的限制。The use of LONG values is subject to some restrictions:A table can contain only one LONG column. 
    You cannot create an object type with a LONG attribute. 
    LONG columns cannot appear in WHERE clauses or in integrity constraints (except that they can appear in NULL and NOT NULL constraints). 
    LONG columns cannot be indexed. 
    A stored function cannot return a LONG value. 
    You can declare a variable or argument of a PL/SQL program unit using the LONG datatype. However, you cannot then call the program unit from SQL. 
    Within a single SQL statement, all LONG columns, updated tables, and locked tables must be located on the same database. 
    LONG and LONG RAW columns cannot be used in distributed SQL statements and cannot be replicated. 
    If a table has both LONG and LOB columns, you cannot bind more than 4000 bytes of data to both the LONG and LOB columns in the same SQL statement. However, you can bind more than 4000 bytes of data to either the LONG or the LOB column. 
    A table with LONG columns cannot be stored in a tablespace with automatic segment-space management. 
    LONG columns cannot appear in certain parts of SQL statements:GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements 
    The UNIQUE operator of a SELECT statement 
    The column list of a CREATE CLUSTER statement 
    The CLUSTER clause of a CREATE MATERIALIZED VIEW statement 
    SQL built-in functions, expressions, or conditions 
    SELECT lists of queries containing GROUP BY clauses 
    SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or MINUS set operators 
    SELECT lists of CREATE TABLE ... AS SELECT statements 
    ALTER TABLE ... MOVE statements 
    SELECT lists in subqueries in INSERT statements 
    Triggers can use the LONG datatype in the following manner:A SQL statement within a trigger can insert data into a LONG column. 
    If data from a LONG column can be converted to a constrained datatype (such as CHAR and VARCHAR2), a LONG column can be referenced in a SQL statement within a trigger. 
    Variables in triggers cannot be declared using the LONG datatype. 
    :NEW and :OLD cannot be used with LONG columns. 
      

  3.   

    使用Long类型的有以下限制:
    一个表只能有一个Long字段。
    你不能创建一个含Long属性的对象类型。
    Long不能出现在WHERE字句中,或者完整性约束中。(除了NULL和NOT NULL约束)
    Long字段不能作为索引。
    存储函数不可以返回Long值。
    你可以在PLSQL单元(过程,函数)中声明一个Long类型的变量,但是,你将无法在SQL中调用此单元。
    在一个SQL语句中,所有Long字段,更新的表,锁定的表都必须在同一个数据库里。
    …………LONG类型的字段不可以出现在SQL语句的某些部分:
    GROUP BY 子句,ORDER BY 子句,或者 CONNECT By 子句,或者含有DISTINCT 的SELECT语句。
    含有UNIQUE的SQL语句。
    在Create Cluster语句的列列表里。
    SQL内建的函数,表达式或者条件。
    ……
    在INSERT语句中的SELECT子查询中!!!!!!!!!!!!
    …………