我正在使用下面的代码从SQL数据库中读取表和视图,这适用于Oracle表但不适用于Oracle视图,是否有人知道它为什么不起作用以及如何解决它?
cmdList = new OdbcCommand("select name, user_name(uid) from sysobjects where type='U' or type='V'", cn);
由于
答案 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';