如何在 PostgreSQL 中使用两个值引发异常?

avi*_*avi 1 sql postgresql

我知道我可以做plpgsqlRAISE Exception '%', variable_name;

但我需要用两个值引发异常:

raise exception 'values %, % are incorrect please check.'(val1,val2);
Run Code Online (Sandbox Code Playgroud)

无论我尝试什么,我仍然得到syntax error

手册没有说明如何做到这一点: https ://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html

我该如何正确设置?

Viv*_* S. 5

你错过了,

raise exception 'values %, % are incorrect please check.',val1,val2;
Run Code Online (Sandbox Code Playgroud)