Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

value too long to fit in (274) - HANA SQL exception handling - problem

$
0
0

Hi

 

I have a situation wherein the data from the source might have string column value of differing length.

 

I wanted to capture the exception for reporting whenever an insert operation happens for that data on the target table.

 

When needed attempt has been made, Hana keeps throwing the exception 359 (concatenated string is too long) whenever this 274 error condition arises and it did not allow the respective exception handling to handle it (rather error was thrown at start of exception handling routine itself).

 

Any ideas from you as how/why not/ to gain control from Hana in handling this exception?

 

Here are the code snippets to better understand the context.

 

Create proc .....

 

Begin

 

 

    FOR V_C1REC as C1 DO

        DECLARE VALUELENGTHERROR CONDITION FOR SQL_ERROR_CODE 274;

 

 

        DECLARE VALUELENGTHERROR_1 CONDITION FOR SQL_ERROR_CODE 359;

 

        DECLARE EXIT HANDLER for VALUELENGTHERROR

        BEGIN

       PTOUT_Ids_failure_1 = SELECT ID FROM :PTOUT_Ids_failure_1 union all

                             select 'LE -' as ID from dummy;

                             --||:v_c1rec.Product_id||'::'||v_c1rec.batch_id as ID from Dummy;

        END;

 

 

        DECLARE EXIT HANDLER for VALUELENGTHERROR_1

        BEGIN

       PTOUT_Ids_failure_1 = SELECT ID FROM :PTOUT_Ids_failure_1 union all

                             select '359 -' as ID from dummy;

                             --||:v_c1rec.Product_id||'::'||v_c1rec.batch_id as ID from Dummy;

        END;

 

        INSERT INTO TABLE   --- with values from data source that is longer than target column's.

 

 

        -- other statements

 

    END FOR;

 

 

-------- other stuffs

 

End;

 

Thank you

kind regards

K Sudhakaran


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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