Select to view content in your preferred language

Use computed columns in feature class

643
2
Jump to solution
05-16-2022 02:35 AM
JuliusKnade
Occasional Contributor

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. 

JuliusKnade_1-1652693180427.png

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. 


0 Kudos
1 Solution

Accepted Solutions
JuliusKnade
Occasional Contributor

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.



 

View solution in original post

2 Replies
MathiasKemeter
Emerging Contributor

Are you able to reproduce the error on DB level by executing GET_BEZIRK directly? Also, which SRS are you using?

0 Kudos
JuliusKnade
Occasional Contributor

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.