tags:

views:

298

answers:

1

Hi all,

I'm using the code below to read tables and views from a SQL database, this works for Oracle tables but not Oracle views, does anyone know why it wouldn't work and how I can fix it?

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

Thanks

A: 
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';
Robert Merkwürdigeliebe