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