【问题标题】:How to catch exceptions in mysql如何在mysql中捕获异常
【发布时间】:2013-09-04 18:52:24
【问题描述】:

我会用java写,

try{
    //do something
}catch(Exception ex){
    //print an error message
}

我想写一个 MySQL 过程/函数来做到这一点。

例如,在表格中插入一些东西。如果失败,则在捕获异常后显示消息。 一个在 PL/SQL 中有一个异常块。 在 MySQL 中可以吗?

【问题讨论】:

标签: mysql exception stored-procedures exception-handling


【解决方案1】:

一种可能的选择是使用QueryScript,一种用于SQL 的脚本语言,具体来说:query_script_try_catch

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-25
    • 2016-11-11
    • 2021-08-06
    • 2011-04-03
    • 2021-03-26
    • 2021-05-23
    • 2023-03-31
    • 1970-01-01
    相关资源
    最近更新 更多