cancel
Showing results for 
Search instead for 
Did you mean: 

getting error feature not supported: expr_agg:

Former Member
0 Kudos

CREATE PROCEDURE "PAYROLLDBTEST".GetWorkingHoursAsFloat

(

  -- Add the parameters for the function here

  IN WorkingHours nvarchar(10),

OUT FloatValue float

)

--RETURNS float

LANGUAGE SQLSCRIPT 

AS

BEGIN

  -- Declare the return variable here

  --DECLARE FloatValue float;

  -- Add the T-SQL statements to compute the return value here

FloatValue :=    (SUM(case when (:WorkingHours <> '0')

then

IFNULL(SUBSTRING(:WorkingHours,0, IFNULL(LOCATE(':',:WorkingHours), LENGTH(:WorkingHours))),NULL)

  else 0

end

) * 60)

+

SUM(CAST(IFNULL(SUBSTRING(:WorkingHours, LOCATE(':',:WorkingHours) + 1, LENGTH(:WorkingHours)),NULL) AS INTEGER))

;

IF(:FloatValue /60.0 IS NULL)

THEN

  FloatValue := 0;

  END IF;

  END;

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member188958
Active Contributor
0 Kudos

Which database system is this for (you've posted in the general "Databases" area)?

If you were writing this code for ASE, leaving aside other syntax differences, I would say the problem is that you did not have a SELECT keyword in front of the variable assignement

i.e.

SELECT FloatValue :=    (SUM(case when (:WorkingHours <> '0') [...]

-bret

Former Member
0 Kudos

I am using HANA database.

When i executed above code with SELECT it gives syntax error like :

Could not execute 'CREATE PROCEDURE "PAYROLLDBTEST".GetWorkingHoursAsFloat ( -- Add the parameters for the function ...' in 1 ms 812 µs .

SAP DBTech JDBC: [257] (at 351): sql syntax error: incorrect syntax near ":=": line 15 col 19 (at pos 351) .

and when i do not use SELECT it gives error :

feature not supported:expr_agg.