1

我创建了下表:

Create table temp.test(c1 VARCHAR2(10 BYTE));

我试图使用 CHAR_USED 来确定列大小是 BYTES 还是 CHARS,但我得到的只是'从 1 列获取 0 行'。我使用的数据库版本是 Oracle 11g。有没有人知道为什么它不返回该表的语义长度信息?

使用的查询如下:

select CHAR_USED from all_tab_columns where table_name='temp.test'
select CHAR_USED from all_tab_columns where table_name='test' and owner = 'temp'
4

1 回答 1

0

Assuming that you are not using case-sensitive identifiers (which you are not and should not), object names are stored in the data dictionary in upper case. So when you query a table like all_tab_columns, you'd need to use upper-case

SELECT column_name, char_used
  FROM all_tab_columns
 WHERE table_name = 'TEST'
   AND owner = 'TEMP'
于 2013-03-19T16:43:24.810 回答