cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture error_message when i use "Error Handling"/"Use Overflow file" option in target table

Former Member
0 Kudos

Hi,

I am using "Error Handling"/"Use Overflow file" option in target table to capture errors like "Unique Constraint".

So, When a duplicate key arrives it will be thrown to overflow file and the job is getting succesfully executed aswell as error will be shown in error file.

But if i use this option, catch block will never be executed even if there are errros.

Here i want to capture Error_Messgae() into a gloabl variable (like .. $ERROR=ERROR_MESSAGE()) where this can be done in catch block only!!!

Can some one help how to capture error message when we use this option in target table?

Thanks ,

Amar.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Add a script to the catch block and use variable to capture the raise_exception_ext function. If exception is raised the message will be captured.

Former Member
0 Kudos


Hi,

The problem here is, the program control does not enter catch block only!!!

i . e when error handling is enabled in target table.

Hope you are clear.

Thanks,

Amarnath.

former_member187605
Active Contributor
0 Kudos

Add a script to your job that makes it fail when the overflow file exists, using the file_exists and raise_exception_ext built-in functions.

Former Member
0 Kudos

Hi Dirk,

The Data flow may abort for various reasons like Unique constraint, DB full, Conneciton lost.etc...

Here i need the specific error message into a variable!

So, file_exists can only say if there were error records or not, but it wont say due to what kind of issue the file is generetd!!

Can you help on this?


former_member187605
Active Contributor
0 Kudos

That's not possible. Suppose you get different types of errors during processing (duplicate key, invalid date format, number overflow...) all recorded in the file, which error message are you going to insert into your global variable?