bit类型有两种取值:0和1,有两种赋值方式:
DECLARE i_isstop bit;
BEGIN
i_isstop :='1'; -- 第一种写法
i_isstop := 1::bit; -- 第二种写法
select * from "public"."frm_department" where isstop=i_isstop;
END;
有还一个坑,变量命名不能和列名一样,一样时不会识别为变量。如下面是错误写法:
DECLARE isstop bit;
BEGIN
isstop :='1';
select * from "public"."frm_department" where isstop=isstop ;
END;