Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/corpus/watcom/exception-handler.expected.sql
Original file line number Diff line number Diff line change
@@ -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;
8 changes: 8 additions & 0 deletions test/corpus/watcom/exception-handler.input.sql
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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;
Loading