Hi All,
I am using spatial function in procedure, i am able to activate the procedure without any error but when calling the procedure am getting below error.
Could not execute 'CALL "_SYS_BIC"."s0014297849trial.hanadev/PR_SPATIAL_METHOD"('CHN01','CHN02',?)' in 39 ms 537 µs .
SAP DBTech JDBC: [257]: sql syntax error: [257] sql syntax error: Syntax for Spatial Functions must be in Objective-style: line 3 col 40 (at pos 302)Please check lines: 8,
It is saying code should be in objective-style, Can't able to find what is that objective-style:
Below is the code from proc:
/********* Begin Procedure Script ************/
BEGIN
v_selfjoin = select A.BRANCH_ID AS BRANCHID,A.LONGLAT.ST_Distance(B.LONGLAT) AS
DISTANCE FROM"NEO_B45RWNY007IMPIDRM4ZSG1OV0"."COMPLOC" A,
"NEO_B45RWNY007IMPIDRM4ZSG1OV0"."COMPLOC" B
WHERE A.BRANCH_ID = :LOC1 AND B.BRANCH_ID = :LOC2;
var_out = select A.BRANCHID,B.BRNAME,A.DISTANCE
FROM :v_selfjoin A,"NEO_B45RWNY007IMPIDRM4ZSG1OV0"."EMP_BRANCH" B
WHERE A.BRANCHID = B.BRANCHID;
END;
/********* End Procedure Script ************/
But when using sql editor to achieve the same result it is not throwing any error and am able to see the output.
SQL Editor:
select A.BRANCH_ID AS SOURCELOC,B.BRANCH_ID AS DESTLOC,to_decimal(A.LONGLAT.ST_Distance(B.LONGLAT)/1000,4,2) AS
DISTANCE,a.brname as sourceloc,b.brname as destloc FROM (select a.branch_id,a.longlat,b.brname from
"NEO_B45RWNY007IMPIDRM4ZSG1OV0"."COMPLOC" A innerjoin"NEO_B45RWNY007IMPIDRM4ZSG1OV0"."EMP_BRANCH" B on a.branch_id = b.branchid) A,
(select a.branch_id,a.longlat,b.brname from
"NEO_B45RWNY007IMPIDRM4ZSG1OV0"."COMPLOC" A innerjoin"NEO_B45RWNY007IMPIDRM4ZSG1OV0"."EMP_BRANCH" B on a.branch_id = b.branchid) B
WHERE A.BRANCH_ID = 'CHN01'AND B.BRANCH_ID = 'CHN02';
Above code executes without any error. Please anyone help me in solving this issue.
Thanks,
Rithika