Skip to Content
0

Hana grid cluster error: cannot use parameter variable

May 21, 2017 at 06:03 PM

135

avatar image
Former Member

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;

END;
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.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Florian Pfeffer
May 21, 2017 at 06:13 PM
1

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

Share
10 |10000 characters needed characters left characters exceeded