读书人

批改字段信息

发布时间: 2012-07-31 12:33:46 作者: rapoo

修改字段信息

?

?

--添加ID字段alter table UTDICTIONARYT_TEMP drop column ID;alter table UTDICTIONARYT_TEMP add ID number;--创建存储过程CREATE OR REPLACE PROCEDURE TEST_TEMPINFO is    cursor         crs_ut     is         select * from utdictionaryt_temp for update;        var_index_id NUMBER;BEGIN         var_index_id := 1;         FOR r_ut in crs_ut LOOP             UPDATE utdictionaryt_temp SET id = var_index_id WHERE current of crs_ut;             var_index_id := var_index_id + 1;          END LOOP;END;/COMMIT;execute test_tempinfo;commit;--添加主键alter table UTDICTIONARYT_TEMP add constraint utdictionaryT_TEMP_1001 primary key (ID);commit;

?

读书人网 >其他数据库

热点推荐