Page 1 of 1
Using TUniMetadata to get field names and types
Posted: Wed 14 Jan 2009 10:44
by JensFudge
Hi,
I want to get the fieldnames and datatypes from a table using the TUniMetaData component.
The datatypes are apparently stored as an integer.
Where can I see what the integervalue corresponds to?
I have for example got datatypes 7, 8 and 27 in a specific table..
Is there some built-in way to get the names in stead?
For example:
Smallint, Integer, double..
Thanks for your help
Regards
Jens Fudge
Posted: Thu 15 Jan 2009 08:51
by Plash
Please specify the provider that you are using: Oracle, InterBase, etc.
Posted: Thu 15 Jan 2009 09:02
by JensFudge
At the moment I am using Interbase provider on a Firebird database, but the reason for using UniDac components is, that we will be supporting Oracle, MS-SQL, MySQL and Firebird...
So, if it could be generic, that would be great.
Thanks
/Jens Fudge
Posted: Fri 16 Jan 2009 11:59
by Plash
We will investigate possibility to support data type names in the TUniMetaData component, but that is hardly to happen in the nearest future.
Posted: Fri 16 Jan 2009 12:15
by JensFudge
For which I will eagerly await.
In the meantime, do you have any documentation of which datatypes get which numbers?
Do they differ depending on the provider?
I know that 27 for interbase is double

But I would like it if you could point me to a map or something, I can easily implement a map with a TDictionary or something..
But I don't know the values.
/Jens
Posted: Mon 19 Jan 2009 08:55
by Plash
Unfortunately the meaning of the DATA_TYPE field differs depending on the provider. In the Oracle provider there are already string data type names.
For the InterBase provider you can get corresponding data type names using the following query:
Code: Select all
SELECT * FROM RDB$TYPES
WHERE RDB$FIELD_NAME = 'RDB$FIELD_TYPE'