Using TUniMetaData
Using TUniMetaData
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.
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:
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.
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;