All Manuals > LispWorks® User Guide and Reference Manual > 45 The SQL Package

create-index Function

Summary

Creates an index for a table.

Package

sql

Signature

create-index name &key on unique attributes database

Arguments
name
The name of the index.
on
The name of a table.
unique
A boolean.
attributes
A list of attributes.
database
A database.
Description

The function create-index creates an index called name on the table specified by on. The attributes of the table to index are given by attributes. Setting unique to t includes UNIQUE in the SQL index command, specifying that the columns indexed must contain unique values.

The default value of unique is nil. The default value of database is *default-database*.

Examples
(create-index [manager]
   :on [emp] :unique t :attributes '([ename] [sal]))
See also

*default-database*
drop-index
create-table


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:56