尝试/捕获语法 [英] Try/catch syntax

查看:80
本文介绍了尝试/捕获语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何无法通过简单的try/catch获得正确的语法? 我还需要做更多的事情吗?

How can I not get the right syntax for a simple try/catch? Do I have to do anything more?

我得到的只是错误1064 ...

All I get is error 1064...

BEGIN TRY
SELECT * FROM NonExistentTable;
END TRY

BEGIN CATCH
SELECT * FROM ExistingTable;
END CATCH;
GO

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRY
SELECT * FROM NonExistentTable' at line 1 

谢谢

推荐答案

MySQL不具有TRY/CATCH功能.您可以使用处理程序.

MySQL doesn't have TRY/CATCH functionality. You can use handlers.

这篇关于尝试/捕获语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆