Display sdo_geometry as text?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Display sdo_geometry as text?

Post by MarkF » Wed 24 Oct 2007 13:50

Hi all!

I'd like to display an sdo_geometry value as text (instead of breaking each item into a different column the way the dataset seems to do by default. Is there any way to do this? SQLPlus shows an sdo_geometry field like this:

SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3), SDO_ORDINATE_ARRAY(1, 1, 5, 7))

Thanks for any help or suggestions!

-Mark Ford
Benthic Software

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 25 Oct 2007 07:41

ODAC doesn't have such feature.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Thu 24 Jan 2008 14:37

Is there any way for me to handle sdo_geometry (or any object for that matter) myself? I'm using datasets and the object gets broken up into over 200 (I think) separate columns. I'd like to have it come back as a single field and then process the display myself. Is there a way to suppress the way that objects get broken out into separate fields?

Thanks for any suggestions!

-Mark Ford
Benthic Software

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Thu 24 Jan 2008 15:06

What about :

Code: Select all

ObjectView := False;
Greetings
Jens

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Thu 24 Jan 2008 21:21

Hi Jens,

Thanks for the pointer! It looks like ObjectView has to be set to true to not expand the objects (so ObjectView set to the default, false, is what expands the objects.) I couldn't find it in the help files at all.

The real issue is that I actually like the ObjectView = False behavior for all objects except sdo_geometry (which expands to hundreds of fields.) I'd love to see an SDO_GeometryAsText option added.

-Mark

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Fri 25 Jan 2008 02:18

Thanks against for the ObjectView suggestion! With ObjectView set to true and using GetObject and checking the ObjectType.Name I've managed to get a nice text representation of the SDO_Geometry object. The issue now is that I'd like to show other objects as text also. SQLPlus manages to take any object (or at least my simple tests) and give a text representation like:

PATIENT_OBJ(ID, LAST_NAME, FIRST_NAME)
--------------------------------------
PATIENT(1, 'Ford', 'Mark')

I'm new to working with TOraObject so I was just wondering if anyone has any suggestions, pointers, or code to help me out in turning generic Oracle objects into a string similar to above.

Thanks!

-Mark Ford

Post Reply