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

02-14-05, 01:19
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 1,570
|
|
|
How to display 'list application' without header?
|
|
Hi,
I would like to display 'list application' without header. Below sample returs applications with header.
Sample: db2 list application for database sample
Code:
Auth Id Application Appl. Application Id DB # of
Name Handle Name Agents
-------- -------------- ---------- ------------------------------ -------- -----
DBuser db2bp.exe 3 *LOCAL.DB2.050214061106 SAMPLE 1
I would like to get only:
Code:
DBuser db2bp.exe 3 *LOCAL.DB2.050214061106 SAMPLE 1
Is there any command to get result of 'list application' without header?
Thanks,
Grofaty
|
|

02-14-05, 02:37
|
|
Super Moderator
|
|
Join Date: Aug 2001
Location: UK
Posts: 4,534
|
|
AFAIK, you cannot using the command ...
You may try using the udfs to get the same output without headers
Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
|
|

02-14-05, 03:13
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 191
|
|
|
|
db2 list applications | grep -v "^Auth\|^--\|^ "
This does assume that you have a grep command available (ie you're using a *ix or have Windows with cygwin or have MKS etc)
James Campvell
|
|

02-14-05, 05:00
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 1,570
|
|
jacampbell,
thanks a lot! You gave me a super idea. I used 'find' instread of 'grep' so the command on Windows is:
db2 list application for database sample | find /v "Auth" | find /v "--" | find /v "Name"
Grofaty
|
Last edited by grofaty; 02-14-05 at 05:03.
|

02-14-05, 16:17
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Netherlands
Posts: 96
|
|
Quote:
|
Originally Posted by grofaty
jacampbell,
thanks a lot! You gave me a super idea. I used 'find' instread of 'grep' so the command on Windows is:
db2 list application for database sample | find /v "Auth" | find /v "--" | find /v "Name"
Grofaty
|
Hi,
Another great standard available command is findstr. It also supports regular expressions.
|
|

02-14-05, 16:59
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
how about this:
Code:
db2 -x "select t.auth_id, t.appl_name, t.agent_id, t.appl_id, t.db_name, t.num_assoc_agents from table(snapshot_appl_info('ZZZ',-1)) t"
|
Last edited by n_i; 02-14-05 at 19:56.
|

02-15-05, 03:17
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 1,570
|
|
Hi,
Thanks a lot, to all of you. I have solved my problem!
BTW, n_i: executing command above returns error:
Code:
SQL0440N No function by the name "SNAPSHOT_APPL_INFO" having compatible
arguments was found in the function path. SQLSTATE=42884
My system:
Windows XP SP2
DB2 v7.2 FP5
Thanks,
Grofaty
|
Last edited by grofaty; 02-15-05 at 03:22.
|

02-15-05, 09:25
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
Snapshot functions are only available in v8.
|
|

02-15-05, 11:55
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 138
|
|
Quote:
|
Originally Posted by grofaty
Hi,
Thanks a lot, to all of you. I have solved my problem!
BTW, n_i: executing command above returns error:
Code:
SQL0440N No function by the name "SNAPSHOT_APPL_INFO" having compatible
arguments was found in the function path. SQLSTATE=42884
My system:
Windows XP SP2
DB2 v7.2 FP5
Thanks,
Grofaty
|
the one that worked for me
db2 list applications | grep -v "^Auth"| grep -v "^--"|grep -v "^ "
the last grep---> "grep -v "^followed by 8 spaces"
n_i, your command resulting in same error, SQL0440N . I am using v8.1 fp6a
|
Last edited by chavadb2; 02-15-05 at 15:45.
|

02-16-05, 23:36
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 191
|
|
Since this is still alive, I suppose I should add that the first grep test should be: grep -v "^Auth Id " in case someone has a userid that starts Auth.
James Campbell
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|