User Data Types

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

User Data Types

Post by jdorlon » Fri 05 Jan 2007 22:13

Hello,

Assuming we have a table like this:

CREATE TABLE TBL_POSITION (POSITION_NAME VARCHAR2(24 BYTE), COORDINATES MDSYS.SDO_POINT_TYPE);

And to insert some data, we can do this:

INSERT INTO TBL_POSITION ( POSITION_NAME, COORDINATES) VALUES ('Point1', MDSYS.SDO_POINT_TYPE(10, 20, NULL));

Now, when we do a "select * from tbl_position" with a TSmartQuery, is there any way to tell from the TField for the 2nd column that it is of type MDSYS.SDO_POINT_TYPE?

Also, when I query the data, the field value comes back as "10, 20, ". Is there any way to get "10, 20, NULL"?

Thanks,
-John

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

Post by Plash » Tue 09 Jan 2007 10:29

If TSmartQuery.ObjectView property is set to True the following code can be used to get an object type name:

TADTField(SmartQuery.FieldByName('COORDINATES')).ObjectType

Alternatively the following code can be used:

SmartQuery.GetObject('COORDINATES').ObjectType.Name

We get Null variant for COORDINATES.Z when using the Value or the AsVariant properties of TField.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Post by jdorlon » Tue 09 Jan 2007 16:06

Excellent, thank you!

Post Reply