【问题标题】:Reading Long Datatype and wirte it into an other Long Datatype读取 Long 数据类型并将其写入另一个 Long 数据类型
【发布时间】:2011-01-21 10:39:14
【问题描述】:

我有一个小问题:

我正在使用 SP 从表 SYSADM.aaTest 中读取数据并将其放入 MYSCHEMA.aaTest 现在我的问题是这个表中有 Long 类型。

desc aaTest
Name                           Null     Typ
------------------------------ -------- ----------------
ID_TEST                        NOT NULL NUMBER
RELEASE                                 NUMBER 
NAME                                    VARCHAR2(50)
XML_FILE                                LONG()   

一些 XML_File 的 r 长于 32760 个字符:/

我的程序如下所示:

create or replace
PROCEDURE  aaTest_Proc  
(  
p_persid IN person.persid%TYPE DEFAULT NULL  -- used for errormanagemant 
) 
IS 
v_errornum NUMBER   :=0; 
v_errormsg VARCHAR2(4000) :=NULL; 

BEGIN   

for rec in(
select id_patch , release, NAME , xml_file
FROM sysadm.aaTest  
)

loop


 INSERT INTO MYSCHEMA.aaTest
( id_patch , release , NAME , XML_File ) 
VALUES
( rec.id_patch , rec.release , rec.NAME , rec.xml_file );

End loop;

Exception
…

有没有办法将它们完全读出并将其写回另一张表? 顺便说一句,此版本适用于低于 32k 字符的文件,但更多会出错

btw2:我知道 CLOB 会更好,但我无法将 Column 更改为 CLOB,所以我需要保持 Long :/

那是你的帮助 奥罗

【问题讨论】:

    标签: oracle stored-procedures oracle10g


    【解决方案1】:

    您不能使用 pl/sql 插入大于 32k 的 LONG。您可以使用COPY command from SQL*Plus to move LONGs

    另见:

    how to select and insert a long type column

    【讨论】:

    • damit 我希望有办法,但看起来我需要对程序进行更新...:/
    • @Auro:不幸的是,您必须找到解决方法:您必须使用外部程序(SQL*Plus 或 java、C 中的外部程序...)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-24
    • 1970-01-01
    • 1970-01-01
    • 2018-04-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多