diff --git a/test/corpus/watcom/exception-handler.expected.sql b/test/corpus/watcom/exception-handler.expected.sql new file mode 100644 index 0000000..4fa51e1 --- /dev/null +++ b/test/corpus/watcom/exception-handler.expected.sql @@ -0,0 +1,10 @@ +CREATE PROCEDURE dbo.handle_import_errors() +BEGIN + SET status_code = 1; +EXCEPTION + WHEN OTHERS THEN + BEGIN + SET status_code = 0; + SELECT sqlcode, SQLSTATE; + END +END; diff --git a/test/corpus/watcom/exception-handler.input.sql b/test/corpus/watcom/exception-handler.input.sql new file mode 100644 index 0000000..86bdae4 --- /dev/null +++ b/test/corpus/watcom/exception-handler.input.sql @@ -0,0 +1,8 @@ +create procedure dbo.handle_import_errors() +begin +set status_code = 1; +exception when others then begin +set status_code = 0; +select sqlcode, sqlstate; +end +end; diff --git a/test/corpus/watcom/exception-resume-and-declarations.expected.sql b/test/corpus/watcom/exception-resume-and-declarations.expected.sql new file mode 100644 index 0000000..b88e1d0 --- /dev/null +++ b/test/corpus/watcom/exception-resume-and-declarations.expected.sql @@ -0,0 +1,6 @@ +CREATE PROCEDURE dbo.exception_resume_guard() +BEGIN + ON EXCEPTION RESUME + DECLARE "validation_error" EXCEPTION FOR SQLSTATE VALUE '75000'; + SELECT 'exception when others then begin' AS note -- exception when others then begin +END; diff --git a/test/corpus/watcom/exception-resume-and-declarations.input.sql b/test/corpus/watcom/exception-resume-and-declarations.input.sql new file mode 100644 index 0000000..01279d0 --- /dev/null +++ b/test/corpus/watcom/exception-resume-and-declarations.input.sql @@ -0,0 +1,6 @@ +create procedure dbo.exception_resume_guard() +begin +on exception resume +declare "validation_error" exception for sqlstate value '75000'; +select 'exception when others then begin' as note -- exception when others then begin +end;