首页 文章

postgresql函数创建错误

提问于
浏览
0

我试图使用PGAdmin工具在PostgreSQL中创建函数,但它给我语法错误 . 我提到下面的功能 .

create or replace FUNCTION "QTYONHOLDORLOCKOR" (
    M_Product_ID numeric, M_Warehouse_ID numeric,
    M_Locator_ID numeric, LocatorType character varying
) RETURNS numeric as language java
NAME org.compare.sqlj.Product.bomQtyOnHold(int,int,int,java.lang.String) return java.math.BigDecimal';

它给了我以下错误

ERROR: syntax error at or near "language"

SQL状态:42601

1 回答

  • 1

    这是因为你没有在“as”和“language”之间创建你的函数体

    create or replace FUNCTION "QTYONHOLDORLOCKOR" (
          M_Product_ID numeric, M_Warehouse_ID numeric,
          M_Locator_ID numeric, LocatorType character varying
      ) RETURNS numeric as 
           $BODY$
                // Your java code here
                return 1;
           $BODY$ 
      language java
    

相关问题