赞
踩
- CREATE OR REPLACE FUNCTION p_fx_*** ( OUT v_row INTEGER, OUT v_rote varchar(50), OUT v_log varchar(50))
- AS $$
- DECLARE
- BEGIN
-
- select count(*) into v_row from *插入表的名字*;
- v_rote := 'SUCCESS';
- v_log := 'SUCCESS';
-
- END
- $$
- LANGUAGE plpgsql VOLATILE
- do $$
- declare ***:=***;
- begin
- while *** loop
- end loop;
- end $$;
declare --声明变量,如果声明了变量别忘了加分号;
- do $$
- declare ***:=***;
- begin
- while *循环条件* loop
- for i in 1..12 loop
- raise notice '%',*变量名*;
- end loop;
- end loop;
- end $$;
raise notice '%',变量名;这是输出语句类似于Java中的print。
- CREATE OR REPLACE FUNCTION p_fx_*** ( OUT v_row INTEGER, OUT v_rote varchar(50), OUT v_log varchar(50))
- AS $$
- DECLARE
- BEGIN
-
- while *循环条件* loop
- for i in 1..12 loop
- raise notice '%',*变量名*;
- end loop;
- end loop;
-
- select count(*) into v_row from *插入表的名字*;
- v_rote := 'SUCCESS';
- v_log := 'SUCCESS';
- END
- $$
- LANGUAGE plpgsql VOLATILE
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。