Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Error while creating a function in HANA

$
0
0

Hi Prasant,

 

the following works right here:

CREATE FUNCTION "PLAYGROUND"."UFNGETSALESORDERSTATUSTEXT_TEST"(status tinyint)
RETURNS TABLE("RET" nvarchar(15))
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER AS
-- Returns the sales order status text representation for the status value.
BEGIN    DECLARE "RET" nvarchar(15);    RETURN SELECT        CASE status            WHEN 1 THEN 'In process'            WHEN 2 THEN 'Approved'            WHEN 3 THEN 'Backordered'            WHEN 4 THEN 'Rejected'            WHEN 5 THEN 'Shipped'            WHEN 6 THEN 'Cancelled'            ELSE '** Invalid **'        END    AS "RET"    FROM DUMMY;
END;
select * from "PLAYGROUND"."UFNGETSALESORDERSTATUSTEXT_TEST"(1)

----------------

Statement 'CREATE FUNCTION "PLAYGROUND"."UFNGETSALESORDERSTATUSTEXT_TEST"(status tinyint) RETURNS TABLE("RET" ...' 
successfully executed in 169 ms 814 µs  (server processing time: 166 ms 179 µs) - Rows Affected: 0 

Statement 'select * from "PLAYGROUND"."UFNGETSALESORDERSTATUSTEXT_TEST"(1)' 
successfully executed in 35 ms 990 µs  (server processing time: 29 ms 247 µs)

 

I also think this is related to your system. Which Revision are you using?

-> You can check this by double clicking on the system in tab overview.

 

Best regards

kc


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>