Page 1 of 1

No row was found for FETCH, UPDATE or DELETE; or the result

Posted: Wed Oct 08, 2008 8:01 am
by vputta
My datastage job will delete the records which are older than 60 months in the table.
The job is running fine if there is some data older than 60 months.
But when there is no data older than 60 months it is giving me a fatal error :

Error in row #1
Primary Error:
sqlcode=100, state=HY000, message=[IBM][CLI Driver][DB2/AIX64] SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000

In the UDB DB2 stage i am writing an sql query like :

Delete from table where recorddate < orchestrate.date

here orchestrate.date is the date 60 months old than todays date.

Plz specify how to overcome this error.

Posted: Wed Oct 08, 2008 8:37 am
by ArndW
Always add a dummy record where the date is >60 months old so that the DELETE always has at least one row to process.

Posted: Wed Oct 08, 2008 5:31 pm
by bcarlson
Can you run a check before this job runs that determines if there is anything to delete? That way you don't have to add a dummy record.

Brad.

Posted: Wed Oct 08, 2008 7:29 pm
by shankar_iyer
You can also try supressing this message in the log.

Posted: Fri Oct 10, 2008 6:23 am
by vputta
The table contains very much real production data.
So, i cant insert any dummy records :cry:

The job is as well scheduled in CTRL-M and i am running the job through scripts in unix.
I have coded the script like,if it encounters one fatal error the job will be abended.

Is compressing the message in the log is a permanent solution,if that so then how to do it..?

Posted: Sun Oct 12, 2008 6:16 pm
by shankar_iyer
Select the fatal message in Log in DS director and then from the menu click job>Add Rule to Message Handler. Follow the on screen instructions.

Note: make sure you have selected the appropriate log message. Also consult the administrator as most of the log suppression are not applied in Production environment.