Hello there,
I'd like to use a own SQL function that I created in HANA Studio and added a computed column to my feature class .The SDE is in a SAP Hana Database obviously.
The SQL function looks like this:
CREATE FUNCTION GET_BEZIRK (IN geom ST_GEOMETRY)
RETURNS
namgem NVARCHAR(100) LANGUAGE SQLSCRIPT AS
BEGIN
DECLARE point ST_GEOMETRY;
point = :geom.ST_CENTROID();
SELECT bezirk.NAMGEM INTO namgem FROM "SCHEMA"."BEZIRK" bezirk WHERE point.ST_INTERSECTS(bezirk.shape) = 1;
END;
My expectation is to calculate the column, when a new feature is added to the feature class. The outcome unfortunately looks like this.
Another way to solve the problem is the usage of attribute rules, but to be honest I'd like to use the Database for the heavy lifting.
Maybe some of you guys encountered something similar or has an idea why the field can't be computed in that fashion. I'm a bit clueless.
Solved! Go to Solution.
Hey Mathias,
the function is flawlessly working in the DB. After a quick seach I found this article stating, that computed columns are not supported. Therefore I set the field values via SQL in the db for existing features and created an attribute rule for new features.
Are you able to reproduce the error on DB level by executing GET_BEZIRK directly? Also, which SRS are you using?
Hey Mathias,
the function is flawlessly working in the DB. After a quick seach I found this article stating, that computed columns are not supported. Therefore I set the field values via SQL in the db for existing features and created an attribute rule for new features.