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

create-view Function

Summary

Creates a view using a specified query.

Package

sql

Signature

create-view name &key as column-list with-check-option database

Arguments
name
The view to be created.
as
A SQL query statement.
column-list
A list.
with-check-option
A boolean.
database
A database.
Description

The function create-view creates a view called name using the query as and the optional column-list and with-check-option. column-list is a list of columns to add to the view. with-check-option adds WITH CHECK OPTION to the resulting SQL.

The default value of with-check-option is nil. The default value of database is *default-database*.

Examples

This example creates the view manager with the records in the employee table whose department is 50.

(create-view [manager] :as [select [*]
                            :from [emp]
                            :where [= [dept] 50]])
See also

create-index
create-table
*default-database*
drop-view


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