Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Select statement surpress no matches

$
0
0
Hi,

Is there a way to not output anything if no record is found while doing a select statement? I'm not familiar with db2 at all.

I'm trying to query a db2 db for any failed jobs and output the result to a file but I don't want any file to be created if nothing has been found.

Code:

db2 "select id from aiw.jobs where type='Job' and state_name='Error'"
Quote:

ID
--------------------------------

0 record(s) selected.

Viewing all articles
Browse latest Browse all 13329

Trending Articles