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 > Doubt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-04, 14:26
db2123 db2123 is offline
Registered User
 
Join Date: Dec 2004
Posts: 5
Doubt

I am using MSV DB2 . I want to query a table in a specific database. How do I do it? is it

select * from databasename..Tablename or how it will be

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-10-04, 14:52
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
On DB2 for MVS you never reference the database name in a query. A database in DB2 MVS is totally different than a database on DB2 for other platforms.

You are usually already connected to a DB2 subsystem name through the attachment you are using. If you are using TSO, you can select the DB2 subsystem with DB2I options or defaults (I forget the exact name of the panel). The subsystem name is usually a 3 or 4 character name.

You select from the table-name, just like any other DB2.
__________________
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
  #3 (permalink)  
Old 12-10-04, 16:22
db2123 db2123 is offline
Registered User
 
Join Date: Dec 2004
Posts: 5
Hi Marcus,

Thank you for the reply.

When I am queries sysibm.sysdatabase I am able to see so many databases.
How to assign to a specific database?

Or suppose I am a DBA and created a new database in that subsystem. And I want a specific group only access the that database how it would be done
Reply With Quote
  #4 (permalink)  
Old 12-10-04, 18:20
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
In DB2 for OS/390 you can have many databases in a subsystem. The database is an administrative level only in DB2 for OS/390 and does not affect DML (insert, update, delete, select).

You can grant DBADM access at the database level, but not insert, update, delete, or select access. In DB2 for OS/390, the database is more like a schema in DB2 for other platforms.
__________________
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
  #5 (permalink)  
Old 12-10-04, 21:18
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
In the Mainframe world, a Database is not the same as a Database in the midrange/PC world. The Mainframe Database is a logical grouping of objects that only share a few physical characteristics. In order to get acces to the tables in the database, someone with administrative privileges (DBA) should grant access to those objects. Once you are connected to the subsystem, you can query any object in that subsytem that you have access to. (Sorry to end that last sentence with a preposition.)
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