|
|
发表于 2007/12/7 19:42:39
|
显示全部楼层
呵呵。。给你个脚本把
--1、备份dummy_table中dumy_crypto列的数据
create table dummy_table_temp as select * from dummy_table;
--2、删除dummy_table后,再创建该表
drop table dummy_table;
create table dummy_table (
dummy_aln varchar2 (50) null,
dummy_integer number null,
dummy_smallint number null,
dummy_decimal number (15,2) null,
dummy_amount number (10,2) null,
dummy_float float null,
dummy_yorn number not null,
dummy_upper varchar2 (50) null,
dummy_lower varchar2 (50) null,
dummy_date date null,
dummy_time date null,
dummy_datetime date null,
dummy_duration float null,
dummy_crypto raw (30) null,
dummy_clob clob null,
dummy_tableid number not null,
dummy_blob blob null,
dummy_cryptox raw (10) null,
rowstamp varchar2 (40) not null
);
insert into dummy_table
( dummy_aln, dummy_integer, dummy_smallint, dummy_decimal, dummy_amount,
dummy_float, dummy_yorn, dummy_upper, dummy_lower, dummy_date,
dummy_time, dummy_datetime, dummy_duration, dummy_crypto, dummy_clob,
dummy_tableid, dummy_blob, dummy_cryptox, rowstamp)
values
(' ', null, null, null, null,
null, 1, null, null, null,
null, null, null, null, empty_clob(),
1, empty_blob(), null, maxseq.nextval);
create unique index dummy_table_ndx on dummy_table (dummy_tableid);
create unique index dummy_table_ndx1 on dummy_table (dummy_aln);
CREATE OR REPLACE TRIGGER DUMMY_TABLE_T BEFORE INSERT OR UPDATE ON DUMMY_TABLE FOR EACH ROW DECLARE NEXTVAL INTEGER;
BEGIN SELECT MAXSEQ.NEXTVAL INTO NEXTVAL FROM DUAL; :NEW.ROWSTAMP := NEXTVAL; END;
/
--3、恢复dummy_table中dummy_crypto列数据
update dummy_table t set t.dummy_crypto=( select dummy_crypto from dummy_table_temp );
commit;
drop table dummy_table_temp; |
|