Returns the type of an attribute.
sql
attribute-type attribute table &key database owner => datatype
| attribute⇩ | 
An attribute from table. | 
| table⇩ | 
A table. | 
| database⇩ | 
A database. | 
| owner⇩ | nil,:allor a string. | 
| datatype⇩ | 
A keyword or list denoting a vendor-specific type. | 
The function attribute-type returns the type of the attribute specified by attribute in the table given by table in database.
database defaults to the value of *default-database*.
If owner is nil, only user-owned attributes are considered. This is the default.
If owner is :all, all attributes are considered.
If owner is a string, this denotes a username and only attributes owned by owner are considered.
datatype demotes a vendor-specific type. Examples in a MS Access database are :integer, :longchar and :datetime. When datatype is a list, the second element is the length of the type, for example (:varchar 255).
To print the type of every attribute in the database, do:
(loop for tab in 
      (sql:list-tables)
      do 
      (loop for att in 
            (sql:list-attributes tab)
            do 
            (format t "~&Table ~S Attribute ~S Type ~S" 
                    tab att 
                    (sql:attribute-type att tab))))
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:56