I have a dummy query where I generate an SDE.ST_GEOMETRY point:
select
shape as srid_test
from
(
select
sde.st_geometry ('point (10.01 50.76)', 4326) as shape
from
dual
)
I've written a function that returns the SRID of the point (it's just a test function--it doesn't have a practical purpose yet).
The function works as expected.
with function test_function (shape_in in sde.st_geometry) return number is
srid number;
begin
-- srid := sde.st_srid (shape_in);
select sde.st_srid (shape_in) into srid from dual;
return srid;
end;
select
test_function(shape) as srid_test
from
(
select
sde.st_geometry ('point (10.01 50.76)', 4326) as shape
from
dual
)
You'll notice that I use a query to assign the SRID to the SRID variable:
select sde.st_srid (shape_in) into srid from dual;
Instead of using a query to get the SRID, I want to simply use the ST_SRID function:
srid := sde.st_srid (shape_in);
However, I'm getting an error when I switch from the query to the function:
ORA-06553: PLS-548: invalid use of operator.
with function test_function (shape_in in sde.st_geometry) return number is
srid number;
begin
srid := sde.st_srid (shape_in);
-- select sde.st_srid (shape_in) into srid from dual;
return srid;
end;
select
test_function(shape) as srid_test
from
(
select
sde.st_geometry ('point (10.01 50.76)', 4326) as shape
from
dual
)
Why am I getting this error?
(Oracle 18c, 10.7.1 Geodatabase)
srid :=
part is equivalent tointo srid
, so, what happens if:srid := select sde.st_srid( shape_in) from dual;
?srid := (select sde.st_srid (shape_in) into srid from dual);
. But, unfortunately, I got an error:ORA-00905: missing keyword
.