Quantcast
Channel: SCN : Unanswered Discussions - Database
Viewing all articles
Browse latest Browse all 230

Faulty error handling in DBPROC, MAXDB version 7.8.02.35

$
0
0

I have an update statement which gives an error thus :

 

UPDATE BOSS.T_TESTS

SET VERSION = VERSION + 1

WHERE ID = 1148

AND VERSION = 0

 

Error Executing 'UPDATE BOSS.T_TESTS SET VERSION = VERSION + 1 WHERE ID = 1148 AND VERSION = 0' SAP DBTech JDBC: [-3018]: Invalid numeric parameter

 

The error occurs because the update trigger for the table calls a procedure which has faulty code. So, I want the error to occur.

 

However, if I put my update statement in a dbproc like this :

 

CREATE DBPROC UPDATE_TEST (IN ID INTEGER, IN TEST_DATE DATE, IN REFERENCE VARCHAR (50), IN COMMENTS VARCHAR (500), IN VERSION INTEGER, INOUT NEWVERSION INTEGER) AS

 

TRY

 

    UPDATE BOSS.T_TESTS

    SET    TEST_DATE = :TEST_DATE,

        REFERENCE = :REFERENCE,

        VERSION = VERSION + 1

    WHERE    ID = :ID

    AND        VERSION = :VERSION ;

                   

CATCH

 

        STOP ($RC, $ERRMSG) ;

//

 

and call it like this :

 

create dbproc test as

VAR

    COUNT    INTEGER ;

    OCL        INTEGER ;

call boss.update_test (1148, '2014-09-08', 'jl/109', '', 0, :ocl);

insert into boss.x values (:ocl);

 

//

call test

 

 

I get

 

Statement 'call test' successfully executed in 170 ms

 

The same error is occurring - the update has not succeeded - but the error message is not reported.

 

Is there a workaround or has this been fixed in later DB versions?


Viewing all articles
Browse latest Browse all 230

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>