日期:2014-05-17  浏览次数:20958 次

用户表,建立时在库在是否存在唯一 的编号(ID)
请问,Oracle 11g中,建的用户表,是不是存在一个编号ID,怎样取,在哪个表中,万份感谢!

另,表中的字段,是不是在系统表中,也存在一个编号呢?

------解决方案--------------------
SQL code
select object_id from user_objects where object_type = 'TABLE'
and object_name = '表名';

------解决方案--------------------
SQL code
select object_id from user_objects where object_name='infos'

------解决方案--------------------
探讨
SQL code
select object_id from user_objects where object_type = 'TABLE'
and object_name = '表名';

------解决方案--------------------
SQL> select t.object_name,t.object_id from user_objects t where t.object_name='TB2';
 
OBJECT_NAME OBJECT_ID
-------------------------------------------- ----------
TB2 51332
 
SQL> alter table tb2 rename to tb3;
 
Table altered
 
SQL> select t.object_name,t.object_id from user_objects t where t.object_name='TB2';
 
OBJECT_NAME OBJECT_ID
-------------------------------------------- ----------
 
SQL> select t.object_name,t.object_id from user_objects t where t.object_name='TB3';
 
OBJECT_NAME OBJECT_ID
-------------------------------------------- ----------
TB3 51332
 
SQL>
------解决方案--------------------
探讨
SQL> select t.object_name,t.object_id from user_objects t where t.object_name='TB2';

OBJECT_NAME OBJECT_ID
-------------------------------------------- -------……

------解决方案--------------------
最好的方法就是自己去试验一把!