Using TUniMetaData

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
agghorta
Posts: 1
Joined: Thu 05 Feb 2009 20:35

Using TUniMetaData

Post by agghorta » Thu 05 Feb 2009 20:45

I´m trying to do a data pump from unidac to a UIB component, but I need to create the destination table on the fly. So I give a table name to a procedure and the procedure retrieves the columns names, data kind, size, etc. But I cannot find any kind of help about the TUniMetaData component. Even a example or description on help. So I want to know: how can I use this component? How I retrieve this information so I can build the new table? Any help will be welcome.

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

Post by Plash » Wed 11 Feb 2009 12:47

You can find some help in description of TDAMetaData class. We are planning to enhance the description of the TUniMetaData component in the UniDAC help.
This component is used like a dataset. You call the Open method. Then read data in a loop:

Code: Select all

while not MetaData.Eof do begin
  Name := MetaData.FieldByName('COLUMN_NAME').AsString;
  ...
  MetaData.Next;
end;
There is column DATA_TYPE. But this column contains server-specific values of data type. For Oracle it is data type name that you can use in CREATE TABLE. Other providers return number codes of data type that are specific to server.

Post Reply