cancel
Showing results for 
Search instead for 
Did you mean: 

CATCH EXCEPTION DBIF_DSQL2_SQL_ERROR

Former Member
0 Kudos

Hello all,

I'm querying an external System via DBLINK.

In some cases this results in a dump (e.g. when there are no rows returned).

So i tried to catch the RUNTIME ERROR because i want to continue processing.

I tried the following code but for some reason it continues dumping.

All suggestions welcome!

Thomas

CATCH SYSTEM-EXCEPTIONS OTHERS = 1.

exec sql.

execute procedure p_getidbyname@ZWINCASH

(IN :mg, IN :'Merchand.', IN :'Y', OUT :mgid )

ENDEXEC.

endcatch.

if sy-subrc = 1.

write:/ 'Da ist was falch gelaufen'.

endif.

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You do not appear to be trying to catch a specific system exception. The exception DBIF_DSQL2.... is not a catchable system exception.

Regards,

Rich Heilman

Former Member
0 Kudos

Hello Rich,

Thank you for your response.

So it is true that there are uncatchable exceptions.

I just did'nt want to believe it.

If anybody out there knows a way to prevent a dump on exceptions that are not stated under "catchable RUNTIME ERROR" please tell me!

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In these cases you must prevent them from happening, not sure how you would go about it with your particular case(using native SQL).

Regards,

Rich Heilman

Answers (1)

Answers (1)

Former Member
0 Kudos

Have you tried to incorporate the error capture in your external db procedure and pass the resultant error message as a parameter or a normal raise exception?