在将这段代码编译为Oracle存储的过程时,我收到错误“不一致的数据类型:期望的游标得到CLOB”。我不知道如何将CLOB变量放入输出游标中。
CREATE OR REPLACE PROCEDURE sp_getPolygon
(
CityId IN INT,
Out_CUR OUT SYS_REFCURSOR
) AS
BEGIN
DECLARE
cola_b_geom SDO_GEOMETRY;
returned_json CLOB;
BEGIN
open Out_CUR for
With cte as(SELECT GEOMETRY FROM GISBRANCHES WHERE "FBranchesId" IN (SELECT "Id" FROM "CreBranches" WHERE "FCitiesId" = CityId))
SELECT GEOMETRY into cola_b_geom FROM cte;
returned_json := SDO_UTIL.TO_GEOJSON(cola_b_geom);
--dbms_output.put_line( returned_json );
SELECT returned_json into Out_CUR FROM DUAL;
END;
END sp_getPolygon;
1条答案
按热度按时间fnvucqvd1#
不完全是这样;我不能测试它,因为我没有您的表,但是-程序应该是这样的: