Re: Retreving X, Y, Z from the Geometry column in oracle 10g

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Hebat-Allah Farag wrote:
> I am stick since 2 days at the same point, I am using 10g, PHP my problem
> now is how to fecth the X, Y , z coordinates from the geometry column to
> view it on my web page, i don't understand the (SDO_ORDINATES), what is its
> type & how i can deal with it. my simple code is:
> $conn=oci_connect('User','pass','//localhost/x')
> $sqlCol="SELECT c.GEOMETRY.SDO_ORDINATES from SSS c WHERE c.CODE = '80A' ";
> $resultCol=oci_parse($conn,$sqlCol);
> $excuteResCol=oci_execute($resultCol);
> $resultRecordsCol=oci_fetch_array($resultCol);
>
> I got an error on the last line as (ORA-00932: inconsistent datatypes:
> expected CHAR got ARRAY )
> i don't know how to deal with this resultset.

Since PHP's OCI8 deals with simple types (or arrays of simple types),
you could create a mapping function in PL/SQL.  There is a related
example under the heading "Using PL/SQL Types in PHP" on page 141 of
the current (1.4) version of

  http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf

Also see the use of SDO_UTIL.GETVERTICES in

  http://forums.oracle.com/forums/thread.jspa?messageID=1448667&#1448667

Chris

--
Christopher Jones, Oracle
Email: christopher.jones@xxxxxxxxxx    Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/   Free PHP Book: http://tinyurl.com/f8jad

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux