TRY ... CATCH doesn't work with EXEC SQL?
When I created a native SQL statement, I knew before, that it would take a few tries to get it working. I decided to use exception classes to avoid short dumps, but it didn't work.
Following code causes a short dump because of the dot after :xp_stras in the native SQL SELECT statement:
EXEC SQL PERFORMING list.
SELECT LIFNR, NAME1, STRAS
WHERE UPPER( NAME1 ) LIKE :xp_name1
AND UPPER( STRAS ) LIKE :xp_stras.
write: /1 'CX_SY_NATIVE_SQL_ERROR'.
write: /1 'CX_SY_SQL_ERROR'.
write: /1 'CX_DYNAMIC_CHECK'.
write: /1 'CX_SY_ROOT'.
In ST22 you can see
Name of runtime error: DBIF_DSQL2_SQL_ERROR
The name of the exception is empty, in other short dumps you can find there the name of the exception class. Maybe that's the reason for CATCH does'nt work, but I don't understand it.
Online help for EXEC SQL says:
Cause: SQL-Error at the execution of a Native SQL-command.
Runtime Error: DBIF_DSQL2_SQL_ERROR
We have SAP ECC 6.0 with SAP_BASIS rel. 700 lvl. 0013.
If You have an idea why CATCH doesn't work, please tell me!