常量

本章将讨论 PL/pgSQL 常量。

定义常量的语法:

常量名 constant 数据类型 := 初始值表达式;

示例

do $$ 
declare
   vat constant numeric := 0.1;
   net_price    numeric := 20.5;
begin
   raise notice 'The selling price is %', net_price * ( 1 + vat );
end $$;
要查看完整内容,请先登录