on 05-21-2017 7:03 PM
Hello. i am trying to run this SQLScript code inside a stored procedure to get grid clusters from an existing spatial table:
PROCEDURE "DEMO"."SP_1"()
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
READS SQL DATA AS
BEGIN
declare xLeft double = 32.333;
declare xRight double = 37.313;
declare yUp double = 30.723;
declare yDown double = 33.3107;
SELECT ST_ClusterID() as Cluster_ID,
ST_ClusterEnvelope() as CLUSTER_WKT,
COUNT(*) as COUNTER
FROM "DEMO"."Table_1"
GROUP cluster BY "SHAPE"
using grid x between :xLeft AND :xRight cells 20
y between :yDownAND :yUp cells 20;
but execution failed, with the error: "cannot use parameter variable: XLEFT" (error code 467) I have to get this working, because i want dynamically set the grid boundaries for each state, and I can't use EXECUTE/EXECUTE IMMEDIATE to dynamically generate this query, because it's NOT SECURED. I will be glad to receive any kind of help from you. thanks.
END;
Please check the restrictions for Spatial Support in HANA SQLScript (HANA Spatial Support).There it is clearly described that functions like ST_CLUSTERENVELOPE are not supported in SQLScript.
Why is it necessary to create a stored procedure for your case? Wouldn't it be enough that the client/service executes the SQL with the arguments you need?
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.