Skip to Content
0

ST_DistanceWithin error with stored procedure: "Don't support predicates with different SRIDs yet"

Jan 31, 2017 at 02:41 PM

60

avatar image
Former Member

i am writing a procedure consisting ST_DistanceWithin() for two points but I keep getting the following error:

"SqlScript: Could not derive table type for variable "VAR3" (SQL error: feature not supported: Don't support predicates with different SRIDs yet)"

The SRIDs for both points are the same(4326). The query works well on a SQL console returning the expected output but fails with the stored procedure.

How can I resolve this issue?

CREATE PROCEDURE GET_GEOFENCE_ID_FOR_EVENTS (IN jId INTEGER , IN cId VARCHAR(10) , OUT OUT_TBL "GEOFENCE_ID_FOR_EVENTS")
LANGUAGE SQLSCRIPT
AS 
BEGIN
	var1 = SELECT MAX(G_CREATED) AS G_CREATED, JOURNEYID,C_UNITID
			FROM RAW_CONTAINER_EVENTS_SPATIAL
			GROUP BY JOURNEYID,C_UNITID
			ORDER BY G_CREATED DESC;			
	
	var2 = SELECT RCE.C_LAT_LONG AS C_LAT_LONG,:var1.G_CREATED,:var1.JOURNEYID,:var1.C_UNITID
			FROM RAW_CONTAINER_EVENTS_SPATIAL RCE,:var1
			WHERE RCE.JOURNEYID = :var1.JOURNEYID AND RCE.C_UNITID = :var1.C_UNITID AND RCE.G_CREATED = :var1.G_CREATED;
			
	OUT_TBL = SELECT SG.LOC_ID AS GEOFENCE_ID, :var2.G_CREATED AS G_CREATED, :var2.JOURNEYID AS JOURNEYID, :var2.C_UNITID AS C_UNITID, :var2.C_LAT_LONG AS C_LAT_LONG,'SEA' AS LOCATION
			FROM "SCHEDULE_GEOFENCE" SG, :var2 
			WHERE SG.LONG_LAT.ST_WithinDistance(:var2.C_LAT_LONG,5,'kilometer')=1 AND :var2.JOURNEYID = SG.JOURNEY_ID; 		
END;

Error: Could not execute 'CREATE PROCEDURE GET_GEOFENCE_ID_FOR_EVENTS (OUT OUT_TBL "GEOFENCE_ID_FOR_EVENTS") LANGUAGE ...'
SAP DBTech JDBC: [2862]: SqlScript: Could not derive table type for variable "OUT_TBL" (SQL error: feature not supported: Don't support predicates with different SRIDs yet): line 14 col 2 (at pos 544)

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers