Using IBCMetadata to find field length
Using IBCMetadata to find field length
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
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.
- 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
Thanks for your help.