on 03-17-2016 5:26 AM
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.
Introduction:
Exception handling is a method for handling exception and completion conditions in an procedure. There are three tools can be used:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.