USEGEAR

导航

pg函数的参数一种用法

CREATE OR REPLACE FUNCTION "public"."fn_BillsCharge2Account"("aSQlStr" varchar)
  RETURNS "pg_catalog"."varchar" AS $BODY$BEGIN
    EXECUTE $1 ;
    RETURN '1'; --1:成功;0:失败
END$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100

调用

SELECT * FROM  "public"."fn_BillsCharge2Account"('SELECT * FROM "ExpenseManagement"."ExpenseView" where "是否费用成本" is true  and "Imported" is true ');
SELECT  "public"."fn_BillsCharge2Account"('SELECT * FROM "ExpenseManagement"."ExpenseView" where "是否费用成本" is true  and "Imported" is true ');

 

posted on 2022-05-12 10:37  USEGEAR  阅读(279)  评论(0编辑  收藏  举报