The Database API
The DataFlex language has a set of commands that allow you to query any piece of information about your tables. These are referred to as Database API attributes. The command Get_Attribute is used to query the value of any API attribute. You can use this to query information about:
- A table (e.g., name, description, number of fields, number of indexes, number of records)
- A table’s index (e.g., number of index segments, value of each segment)
- A table’s field (e.g., data type, length, decimal points, field name)
Rather than creating an additional layer of DDO interface to access these values, it is expected that you access this information within a DDO or a component directly, using the Get_Attribute command. Most of these attributes are low level – you should rarely need to access them. If you cannot find a DDO message that returns the information you need, check the API attributes. Within an application, the most commonly required API attributes will be field length and field data type.
The Set_Attribute command can also be used to change database attributes. You would rarely need to do this within an application.