Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Table doesn't exist in dba_tables, dba_objectsbut does in dba_tab_comments?

user13262575Dec 1 2010 — edited Dec 1 2010
Hello,

We have a situation with our vendor's application where it checks in dba_tab_comments for the existence of a table. So it runs this:

SYS@PPRD8> SELECT * FROM dba_tab_comments WHERE table_name='PEBEMPL';

OWNER TABLE_NAME TABLE_TYPE COMMENTS
-----------------------
SYS PEBEMPL TABLE
PAYROLL PEBEMPL TABLE Employee Base Table

There should only be one of these tables so the application throws an error.

However, when I check dba_tables, there is only one table of this name:

SYS@PPRD8> select owner, table_name from dba_tables where table_name='PEBEMPL';

OWNER TABLE_NAME
-----------------------
PAYROLL PEBEMPL

If I check dba_objects, there is also a synonym for this table but only one actual table exists:

SYS@PPRD8> SELECT owner, object_name, object_type FROM dba_objects Where object_name='PEBEMPL';

OWNER OBJECT_NAME OBJECT_TYPE
-----------------------
PUBLIC PEBEMPL SYNONYM
PAYROLL PEBEMPL TABLE

It seems like a bad idea programmatically to be checking dba_tab_comments instead of dba_tables for the existence of a table but that is something that I can't change. Is there a way to update/refresh dba_tab_comments so it reflects the actual objects that I'm seeing in the database?

Thanks in advance for any ideas you might have.

Edited by: user13262575 on Dec 1, 2010 12:35 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2010
Added on Dec 1 2010
3 comments
517 views