Skip to Content
0
Former Member
Mar 17, 2016 at 05:26 AM

Exception Handling in HANA

773 Views

Hi,

I have created a UDF with try and catch block to handle invalid dates.


My select statement is taking more time than the usual time if I use this function.


How to optimize my below code? or Is there any other way to handle the exception.


Please provide your suggestions.


Below is my function to handle the exception.

CREATE FUNCTION <schema name>.<function name>(INPUT VARCHAR(100))

RETURNS OUTPUT DATE LANGUAGE SQLSCRIPT SQL SECURITY INVOKER

AS

BEGIN

DECLARE EXIT HANDLER FOR SQLEXCEPTION

BEGIN

OUTPUT:=NULL;

END;

OUTPUT:=TO_DATE(:INPUT);

END;

Regards,

Ranjith.