Jump to content
FPiette

How to use FireDAC TFDMetaInfoQuery component?

Recommended Posts

At runtime, I need to discover the structure of a MySQL table (Field names, types, sizes and more]. FireDAC TFDMetaInfoQuery component is supposed to do that but it doesn't work as expected. I got this error message:

[FireDAC][Phys][MySQL]-339. A meta data argument [table type name] value must be specified. Don't tell me to use the auto-created fields.

 

Share this post


Link to post
Posted (edited)
56 minutes ago, Dmitry Arefiev said:

show your code to query meta-data

Just a single line:

FDMetaInfoQuery1.Open;

TFDMetaInfoQuery is connected at design time to a TFDConnection. The same connection is used for several TFDQuery and every request works file.
Extract from the DFM:

object FDMetaInfoQuery1: TFDMetaInfoQuery
  Connection = FDConnection1
  MataInfoKind = mkTableTypeFields
  TableKinds = [tkTable]
  SchemaName = 'MySchema'
  Left = 328
  Top = 64
end

 

Edited by FPiette

Share this post


Link to post

In your example you are missing the ObjectName property it must contain the name of the table that you are querying the fields information.

Share this post


Link to post
58 minutes ago, Lajos Juhász said:

ObjectName property it must contain the name of the table that you are querying the fields information

That was it.

Thanks.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×