下面是对标准视图
user_tab_col
的查询:select * from user_tab_cols;
在Oracle上返回列column_name
和qualified_col_name
。
两者有何不同?
user_tab_col
的查询:select * from user_tab_cols;
在Oracle上返回列column_name
和qualified_col_name
。
两者有何不同?
qualified_col_name
表示 XML 表的完整列路径。它基本上存储了该列的表达式。对于常规列,它将等于 column_name
。
如果您运行:
select owner, table_name, column_name, data_type, qualified_col_name
from all_tab_cols
where column_name <> qualified_col_name;
OWNER TABLE_NAME COLUMN_NAME DATA_TYPE QUALIFIED_COL_NAME
XDB XDB$SIMPLE_TYPE SYS_NC00074$ XDB$APPINFO_LIST_T "XMLDATA"."RESTRICTION"."MIN_INCLUSIVE"."ANNOTATION"."APPINFO"
qualified_col_name
存储类型转换和属性访问的表达式。例如:create or replace type test1_obj as object(
n1 number,
n2 number,
s1 varchar2(10),
s2 varchar2(20)
)
not final;
create or replace type test2_obj under test1_obj(
d1 date,
d2 date
)
not final;
create table object_table of test1_obj;
select column_name, data_type, qualified_col_name
from user_tab_cols
where table_name = 'OBJECT_TABLE'
order by internal_column_id;
对于为类型test2_obj的实例保留的最后两个隐藏系统列,我们可以看到:
COLUMN_NAME DATA_TYPE QUALIFIED_COL_NAME
SYS_NC00010$ DATE TREAT(SYS_NC_ROWINFO$ AS "TEST"."TEST2_OBJ")."D1"
SYS_NC00011$ DATE TREAT(SYS_NC_ROWINFO$ AS "TEST"."TEST2_OBJ")."D2"
describe user_tab_cols;
- ceving