Select particular table name from given database in db2

Here is a simple DB2 - SQL  command to find a particular table name exists in given database name.

SELECT TABNAME FROM SYSCAT.TABLES WHERE TABNAME =''

Example :
Database name : FRSDB
Table Name : DB_VERSION


C:\Users\ADMIN>db2 connect to frsdb

   Database Connection Information

 Database server        = DB2/NT64 10.1.0
 SQL authorization ID   = KRISHNA
 Local database alias   = FRSDB


C:\Users\ADMIN>db2 SELECT TABNAME FROM SYSCAT.TABLES WHERE TABNAME ='DB_VERSION'

TABNAME
--------------------------------------------------------------------------------------------------------------------------------
DB_VERSION

  1 record(s) selected.


C:\Users\ADMIN>


0 comments to "Select particular table name from given database in db2"

Post a Comment

Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")

Popular Posts

Enter your email address:

Buffs ...

Tags


Powered by WidgetsForFree