Object tables don't show up in user_tables?
I recently came across this issue in both an 8.1.7.4 database and a 9.2.0.5 database. I created a table based off an object. The table showed up in user_objects as object_type='TABLE', but did not show up in user_tables. Does anybody have an explanation as to why this is?
Code:
[email protected]> create or replace type money_t as object
2 (
3 amount number,
4 currency varchar2(3)
5 );
6 /
Type created.
Elapsed: 00:00:00.06
[email protected]> create or replace type moneyhistory_t as object
2 (
3 id number(10),
4 price money_t
5 );
6 /
Type created.
Elapsed: 00:00:00.07
[email protected]> create table moneyhistory_o of moneyhistory_t (
2 id not null,
3 price not null,
4 constraint moneyhistory_pk
5 primary key (id)
6 )
7 object identifier is primary key;
Table created.
Elapsed: 00:00:00.12
[email protected]> select object_name, object_type from user_objects;
OBJECT_NAME OBJECT_TYPE
------------------------------ ------------------
MONEYHISTORY_O TABLE
MONEYHISTORY_PK INDEX
MONEYHISTORY_T TYPE
MONEY_T TYPE
SYS_YOID0000061754$ TYPE
Elapsed: 00:00:00.02
[email protected]> select table_name from user_tables;
no rows selected
Elapsed: 00:00:00.01
[email protected]> desc MONEYHISTORY_O
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER(10)
PRICE NOT NULL MONEY_T