Using IBCMetadata to find field length

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
troberts
Posts: 9
Joined: Thu 01 Mar 2012 01:51

Using IBCMetadata to find field length

Post by troberts » Tue 03 Jul 2012 21:54

Hello, I am wondering if it is possible to obtain the length of a field using IBCMetadata? Specifically I want to find out how many characters in a varchar field.

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Using IBCMetadata to find field length

Post by ZEuS » Wed 04 Jul 2012 07:12

Yes, to do this you should perform the following:
- set the TIBCMetadata.MetadataKind property to Columns;
- set the TABLE_NAME restriction value in the TIBCMetadata.Restrictions property to the table name you need;
- set the TIBCMetadata.Active property to True.
Now, you can locate the column by the COLUMN_NAME field and obtain the length of the column from the DATA_LENGTH field.

troberts
Posts: 9
Joined: Thu 01 Mar 2012 01:51

Re: Using IBCMetadata to find field length

Post by troberts » Wed 04 Jul 2012 22:13

Thanks for your help.

Post Reply