TOracleQuery.FieldType function ?

Sunny

Member
I am trying to denormalize a complex query involving multiple table joins i.e
[select a.col1,a.col2,b.col3,b.col4
from table1 a, table2 b
where a.col1 = b.col1 ]

Now I want to generate Create Table DDL for resulting data set by using TOracleQuery.FieldType function. It works fine for these type of fields(otInteger, otString, otFloat, otDate, otLong, otLongRaw, otCursor) but does not recognize these field types (otRowId,otRaw,otClob,otBlob,otBfile,otChar).

I know you can query user_tab_colums to get accurate data types for each column in the result set but it is inefficient for a complex query involving multiple tables. I was wondering if there is any way TOracleQuery.FieldType function can accurately return the datatype of each column from the result set.

any replies appreciated

-Sunny
 
The TOracleQuery.FieldType function returns the Delphi / C++Builder representation of the field. For example, a Raw field is treated as a string, and therefore returns otString. To get hold of the actual field type in the database, use the TOracleQuery.FieldDBType function.

------------------
Marco Kalter
Allround Automations
 
Mr. Kalter, below you mention the Query.FieldDBType function. Where is the documentation for that function?

Originally posted by mkalter:
The TOracleQuery.FieldType function returns the Delphi / C++Builder representation of the field. For example, a Raw field is treated as a string, and therefore returns otString. To get hold of the actual field type in the database, use the TOracleQuery.FieldDBType function.
 
It is not documented, and is only used internally by Direct Oracle Access. The values that are returned correspond to the External Datatype Codes documented in the "OCI Programmer's Guide".

------------------
Marco Kalter
Allround Automations
 
Back
Top