Use TZMetaData to identify what type of field
Posted: 25.01.2022, 20:42
Hello,
In my application the user can enter a TABLE.FIELD string and my code will "convert" that to a different format (XML needed for FastReport). To be able to do that I need to identify what kind of field is that in the database. Until now I executed a dummy query... SELECT field FROM table WHERE 1=0. After opening the query I simply checked the field's DataType.
I now changed this so that the user can select the table from a combo box and instead of entering everything I'm showing a TZMetaData result of the columns of said table. As I already have everything from TZMetaData, I'm wondering if I can ditch the dummy query and get the field type somehow. Unfortunately datatype as number and as string are coming from the RDBMS and are different in each.
If TZMetaData can not give me this information, are there better ways to determine the field type instead of the dummy query?
In my application the user can enter a TABLE.FIELD string and my code will "convert" that to a different format (XML needed for FastReport). To be able to do that I need to identify what kind of field is that in the database. Until now I executed a dummy query... SELECT field FROM table WHERE 1=0. After opening the query I simply checked the field's DataType.
I now changed this so that the user can select the table from a combo box and instead of entering everything I'm showing a TZMetaData result of the columns of said table. As I already have everything from TZMetaData, I'm wondering if I can ditch the dummy query and get the field type somehow. Unfortunately datatype as number and as string are coming from the RDBMS and are different in each.
If TZMetaData can not give me this information, are there better ways to determine the field type instead of the dummy query?