0

I am trying to create the function in PostgreSQL using PGAdmin tool but it giving me syntax error. I am mentioning the function below.

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';

it gives me following Error

ERROR: syntax error at or near "language"

SQL state: 42601

2
  • 1
    And what is the error you get? Commented Aug 4, 2016 at 13:30
  • ERROR: syntax error at or near "language" SQL state: 42601 Commented Aug 4, 2016 at 13:32

1 Answer 1

1

it's because you don't create body of your function between "as" and "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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.