If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Accessing db2 catalog tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-04, 05:24
RudiVdm RudiVdm is offline
Registered User
 
Join Date: Sep 2003
Posts: 17
Accessing db2 catalog tables

Hi

Simple question ...
I need to access SYSCAT>VIEWS ... and this doesn't work :
SELECT * FROM SYSCAT.VIEWS


How should I access the contents of that table?

Thanks
Reply With Quote
  #2 (permalink)  
Old 01-22-04, 05:42
RudiVdm RudiVdm is offline
Registered User
 
Join Date: Sep 2003
Posts: 17
Note :

I get 'Invalid object 'VIEWS'
Reply With Quote
  #3 (permalink)  
Old 01-22-04, 06:26
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: Accessing db2 catalog tables

Assume you are NOT using Unix or Windows version of db2
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 01-23-04, 02:57
RudiVdm RudiVdm is offline
Registered User
 
Join Date: Sep 2003
Posts: 17
No, neither. Using OS2 I think, standard AS/400 operating system.
Reply With Quote
  #5 (permalink)  
Old 01-23-04, 05:22
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
OS/2 and AS/400 are completely different operating systems.

Find the SQL Reference manual for your platform and look in the Appendix for Catalog Tables or Catalog Views. On some platforms (like mainframe) it would be called sysibm.systables with a "V" in the TYPE column.

On Linux, UNIX, and Windows (and older DB2 versions that supported OS/2) you can query syscat.tables with with a "V" in the TYPE column. or you can query sycat.views.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 01-23-04, 06:51
aloz aloz is offline
Registered User
 
Join Date: May 2003
Location: San Juan, PR
Posts: 18
The name of the system table for views is SYSVIEWS.
For mainframe, use SYSIBM.SYSVIEWS. In other environments, use SYSCAT.SYSVIEWS
Reply With Quote
  #7 (permalink)  
Old 01-23-04, 06:54
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Sorry ...

Does the 'other' include AS400

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On