Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

SQL Inline Functions

$
0
0

All,

 

Apologies I'm pretty new to SAP Hana and come from a SQL Server/Oracle background.

 

Anyway problem:

SAP Hana Function

CREATE FUNCTION "SURF_ST"."IS_NUMERIC"(input1 NVARCHAR(128))

RETURNS output1 DOUBLE LANGUAGE SQLSCRIPT

AS

BEGIN

 

   DECLARE EXIT HANDLER FOR SQLEXCEPTION

    BEGIN

        output1 := 0;

    END;

   

    output1 := CAST(:input1 AS DOUBLE) * 2;

END;

 

Case Statement:

CASE

  WHEN "SURF_ST"."IS_NUMERIC"(IFNULL(LATITUDE, 0)) > 0 THEN LATITUDE

  WHEN "SURF_ST"."IS_NUMERIC"(IFNULL(LATITUDE, 0)) < 0 THEN LATITUDE

  ELSE NULL

  END AS "ACCOUNT_LATITUDE"

 

The Calc view compiles fine and reports no errors, however when I try to visualize the data it throws an error as attached.

 

Thanks in advance,

 

Will


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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