Page 1 of 1

Using IBCMetadata to find field length

Posted: Tue 03 Jul 2012 21:54
by troberts
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.

Re: Using IBCMetadata to find field length

Posted: Wed 04 Jul 2012 07:12
by ZEuS
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.

Re: Using IBCMetadata to find field length

Posted: Wed 04 Jul 2012 22:13
by troberts
Thanks for your help.