Sample Header Ad - 728x90

Raise severity for warning?

0 votes
2 answers
120 views
I noticed that importing data that truncates, only raises a warning. T thought it would be simple to just catch that warning and signal an error via a handler, but I don't seem to be able to do that. Any suggestions? CREATE OR REPLACE PROCEDURE FILE_IMPORT_HANDLER(filename VARCHAR(255), tablename VARCHAR(255)) LANGUAGE SQL BEGIN DECLARE EXIT HANDLER FOR SQLSTATE '22001' SIGNAL SQLSTATE '75002' SET MESSAGE_TEXT = '...'; CALL ADMIN_CMD('import from ' || filename || ' of del insert into ' || tablename); END @ I would like to fail hard if 22001 is encountered. In a sense, raise the severity for data truncation during the import
Asked by Lennart - Slava Ukraini (23862 rep)
Jan 25, 2024, 12:34 PM
Last activity: Jan 26, 2024, 09:03 AM