Home >Database >Mysql Tutorial >调整Oracle数据库中表字段的顺序

调整Oracle数据库中表字段的顺序

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:31:34986browse

第一步,从数据字典视图查询出表的id select object_id from all_objects where owner=

第一步,从数据字典视图查询出表的id

select object_id from all_objects where owner='SUNYARD' and object_name='TBL_WDC_INF';

第二步,通过id查出该表中所有字段的顺序

select obj#,col#,name from sys.col$ where obj#=89677;

第三步,,更新字段的顺序

update sys.col$ set col#=0 where obj#=89677 and;
update sys.col$ set col#=7 where obj#=89677 and;
update sys.col$ set col#=9 where obj#=89677 and;
update sys.col$ set col#=4 where obj#=89677 and;
update sys.col$ set col#=3 where obj#=89677 and;


update sys.col$ set col#=8 where obj#=89677 and;
update sys.col$ set col#=5 where obj#=89677 and;
update sys.col$ set col#=2 where obj#=89677 and;

update sys.col$ set col#=1 where obj#=89677 and;

注意:上述更新需要DBA权限

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn