使用SYSobjects在Oracle中读取视图

时间:2009-10-02 09:38:04

标签: c# oracle

我正在使用下面的代码从SQL数据库中读取表和视图,这适用于Oracle表但不适用于Oracle视图,是否有人知道它为什么不起作用以及如何解决它?

cmdList = new OdbcCommand("select name, user_name(uid) from sysobjects where type='U' or type='V'", cn);

由于

1 个答案:

答案 0 :(得分:0)

Sybase/SQL Server: sysobjects
Oracle: ALL_OBJECTS
Notes: The corresponding Oracle tables is: all_objects (Displays all objects that are accessible
by the current user.)
Resolution: Query or make views on ALL_OBJECTS table like:
Select object_name from all_objects where object_type = 'TABLE';
Select object_name from all_objects where object_type = 'PROCEDURE';
Select object_name from all_objects where object_type = 'TRIGGER';
相关问题