線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1430
推到 Plurk!
推到 Facebook!

表的复制

尚未結案
bolidehi
一般會員


發表:11
回覆:11
積分:4
註冊:2004-03-10

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-11-26 10:25:47 IP:221.10.xxx.xxx 未訂閱
我在ORACLE下创建有两个表,其结构完全一样。如下: 人员表 Create Table T_PSN ( ID varchar2(10) not null,//人员编号 Photo LONG RAW //照片 PhotoEXT varchare(3)//照片扩展名 ); 人员备份表 Create Table T_PSNBak ( ID varchar2(10) not null,//人员编号 Photo LONG RAW //照片 PhotoEXT varchare(3)//照片扩展名 ); 现在我要将人员备份表(T_PSNBak)的数据写到人员表(T_PSN)中该怎么写; 要求:1、因为程序改动较大,必须使用将 photo使用long raw类型。 2、用SQL/PLUS语句实现。 我知道:在没有LONG RAW/LONG类型时,可以用以下语句: INSERT INTO T_PSN SELECT * FROM T_PSNBAK WHERE ....; 但是在有LONG RAW类型时,就不行了,执行报错:ORA-00997: 非法使用 LONG 数据类型. 麻烦各位大虾帮忙解决一下怎样用一条语句实现将T-PSNBAK导入到T-PSN。
kgt
高階會員


發表:17
回覆:308
積分:165
註冊:2002-03-13

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-11-26 14:42:15 IP:61.219.xxx.xxx 未訂閱
There are 2 tables for example a(a number,b long raw) and b(a number,b long raw) i used a command to insert all the rows from b into a and i have some errors.Let me know how to resolve this. insert into a select * from b; * ERROR at line 1: ORA-00997: illegal use of LONG datatype ------------------------------------------- If you have any choice in the matter: use LOB's instead. LONG's are a pain to administer/manage and (to quote Jonathan Lewis) "You can't actually do anything with them." AFAIK if you're stuck with LONG, then you'll have to write PL/SQL to do the copy - presumably in 32K chunks. __________________ Banned By Burleson ------------------------------------------- . . . or perhaps you could: 1) export A 2) rename A as B 3) import A but it will play merry hell with any dependencies. __________________ Banned By Burleson
系統時間:2024-05-19 18:52:22
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!