The Significance of Case
You may have
noticed that some attribute names use all
uppercase letters, like NUM_OF_FIELDS, while
others use mixed case letters, like RaiseError. If
you’ve seen any descriptions of individual database drivers you
may have also noticed some attribute names that use all lowercase
letters, like ado_conn and
ora_type.
There is a serious method behind the apparently inconsistent madness. The letter case used for attribute names is significant and plays an important part in the portability of DBI scripts and the extensibility of the DBI itself. The letter case of the attribute name is used to signify who defined the meaning of that name and its values, as follows:
- UPPER_CASE
Attribute names that use only uppercase letters and underscores are defined by external standards, such as ISO SQL or ODBC.
The statement handle
TYPEattribute is a good example here. It’s an uppercase attribute because the values it returns are the standard portable datatype numbers defined by ISO SQL and ODBC, and not the nonportable native database datatype numbers.- MixedCase
Attribute names that start with an uppercase letter but include lowercase letters are defined by the DBI specification.
- lower_case
Attribute names that start with a lowercase letters are defined by individual database drivers. These are known as driver-specific attributes.
Because the meanings are assigned by driver authors without any central control, it’s important that two driver authors don’t pick the same name ...