yeg*_*256 37 postgresql postgresql-9.2
我试图在PostgreSQL 9.2中运行它:
RAISE NOTICE 'hello, world!';
Run Code Online (Sandbox Code Playgroud)
服务器说:
Error : ERROR: syntax error at or near "RAISE"
LINE 1: RAISE NOTICE 'hello, world!'
^
Run Code Online (Sandbox Code Playgroud)
为什么?
Tom*_*eif 75
使用匿名代码块:
DO language plpgsql $$
BEGIN
RAISE NOTICE 'hello, world!';
END
$$;
Run Code Online (Sandbox Code Playgroud)
使用%以下内容引用变量:
RAISE NOTICE '%', variable_name;
Run Code Online (Sandbox Code Playgroud)
Clo*_*eto 24
raise是PL/pgSQL唯一的.
http://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html
create or replace function r(error_message text) returns void as $$
begin
raise notice '%', error_message;
end;
$$ language plpgsql;
select r('an error message');
NOTICE: an error message
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
66598 次 |
| 最近记录: |