Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

function to get x, y

don123Dec 14 2012 — edited Dec 17 2012
hi, can you help me to write the function. The function should take table name, geometry column as input and should give id, x coordinate, y coordinate as output. I have tried with the following. The error is below.
========================================================

SQL> show errors
Errors for FUNCTION GETXY:

LINE/COL ERROR
-------- --------------------------------------------
13/10 PLS-00103: Encountered the symbol "," when e
following:
. ( * @ % & = - + ; < / > at in is mod remai
<an exponent (**)> <> or != or ~= >= <= <> a
like4 likec between || multiset member submu

14/1 PLS-00103: Encountered the symbol "CLOSE"


==============================================================

create or replace function getxy

(name in varchar2, geom in mdsys.sdo_geometry, id out number, x out number, y out number)

return number

IS

n1 number;
n2 number;
n3 number;

cursor c1 is select a.idnumber, t.x, t.y from name a, table(sdo_util.getvertices(a.geometry)) t;

begin

open c1;
fetch c1 into n1, n2, n3;

exit when c1%notfound;

return n1, n2, n3;
close c1;
end getxy;
This post has been answered by Simon Greener on Dec 17 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 14 2013
Added on Dec 14 2012
9 comments
1,204 views