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

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

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

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post 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.
It is not that I am addicted to coffee, it's just that I need it to survive.
shankar_iyer
Participant
Posts: 5
Joined: Sun Jun 25, 2006 12:31 am
Location: Melbourne, Australia

Post by shankar_iyer »

You can also try supressing this message in the log.
Shankar Iyer
Business Analyst
Hewett Packard
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post 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..?
shankar_iyer
Participant
Posts: 5
Joined: Sun Jun 25, 2006 12:31 am
Location: Melbourne, Australia

Post 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.
Shankar Iyer
Business Analyst
Hewett Packard
Post Reply