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

asked Aug 4, 2016 at 13:24
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
answered Aug 4, 2016 at 13:41
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.