Page 1 of 1

User Data Types

Posted: Fri 05 Jan 2007 22:13
by jdorlon
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

Posted: Tue 09 Jan 2007 10:29
by Plash
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.

Posted: Tue 09 Jan 2007 16:06
by jdorlon
Excellent, thank you!