cancel
Showing results for 
Search instead for 
Did you mean: 

Exception Handling in HANA

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Introduction:

Exception handling is a method for handling exception and completion conditions in an procedure. There are three tools can be used:

  • EXIT HANDLER
  • CONDITION
  • SIGNAL or RESIGANL.

The DECLARE EXIT HANDLER parameter allows you to define exception handlers to process exception conditions in your procedures.

You can explicitly signal an exception and completion condition within your code using and

More Informations: SAP HANA Central