Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connected to a DB, then what?

Status
Not open for further replies.

Mag0007

MIS
Feb 15, 2005
829
US
I am able to connect to the database, but I am not sure how I can run a SELECT statement in DB2

Can someone please shed some light on this? I have looked thru the DB2 docs, but no luck....
 
Here is an interesting website that pertains to Universeal Database which is part of the DB2 Family:


It included creation, table creation, and running a querry. I am guessing most people use some kind of application. They connect to the database with ODBC Drivers. Often the software that came with the database can run a querry and export it to an application like Excel. Excel has data connection capabilities to import queries.

Many applications can help to build Views of a set of tables and allow the user to use the views to extract data with querries and to provide security.

I suggest you tell us what kind of DB2 database you have and what platform you are running it on. You may need an SQL Server to take full advantage of it.

If you do not like my post feel free to point out your opinion or my errors.
 
I am running Db2 7.1 on AIX.

SOrry for not giving you enough info.

I guess I would like to perform a SELECT on some of my tables...an example would be nice.

I can connect to the database fine, BTW.
 
>db2 list tables
shows you all tables for your current schema (default is userid)

>db2 list tables for all
returns all tables available

>db2 select * from schema.tabname
returns the data from table schema.tabname.

when using
>db2 select * from tabname
DB2 is assuming your own ID as schema, so it will execute a 'select * from userid.tabname'

otherwise: the best SQL Book on DB2 available is still the SQL Cookbook:
On this site even a Version 7 book is still available for download.

Juliane
 
You may need an SQL Server to take full advantage of it.

Perhaps you mean something else than what you wrote down here?

Ties Blom
Information analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top