The function
attribute-type
returns the type of the attribute specified by
attribute
in the table given by
table
. The database, in which
table
is found, has a default 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 - 21 Dec 2011