on 02-13-2018 6:03 PM
Hi,
I'm struggling to get a SQL function to HANA by HANA Studio. This is the code that I'm using:
CREATE FUNCTION "MBCF"."CUSTOM_PRODUCTION_ISSUED" (IN DENTRY nvarchar(20), IN ITEM varchar(20))
RETURNS AVG_PRICE DECIMAL(15, 6)
LANGUAGE SQLSCRIPT
AS
BEGIN
SELECT (SELECT ISNULL(AVG(ISNULL("Price", 0)), 0) FROM IGE1 WHERE "BaseRef" = :DENTRY AND "ItemCode" = :ITEM) INTO AVG_PRICE FROM DUMMY;
END;
But, the following error is presented when executing:
inconsistent datatype: DECIMAL or INT are invalid function argument types: line 7 col 24 (at pos 196)
Any help?
Thanks
Hi,
I did change the ISNULL with a COALESCE and it worked.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to use IFNULL instead of ISNULL, IFNULL is the equivalent SQL function for HANA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.