红移中的re是否等效于以下T-SQL代码段?
BEGIN TRY
{ sql_statement | statement_block }
END TRY
BEGIN CATCH
[ { sql_statement | statement_block } ]
END CATCH
[ ; ]
如何处理红移中的错误?
例如,我得到了以下SQL代码
begin;
drop table if exists [table_new];
drop table if exists [table_old];
create table [table_new] as
select * from [table_source];
alter table [current_table] rename to [table_old];
alter table [table_new] rename to [current_table];
commit;
从本质上讲,数据是从视图中提取并放入表中的。
如果视图中的任何源为空,将导致错误,如果我重新运行上述代码,它将返回以下内容。
[25P02]错误:当前事务中止,在事务块结束之前忽略命令
本质上,如何在出错时回滚事务?
非常感谢