CREATE-VIEW — Create a database view.
Function
The name of the view as a string, symbol or SQL expression.
A database object which defaults to *default-database*.
A symbolic SQL query expression.
A list.
A Boolean.
Creates a view called name in database which defaults to *default-database*. The view is created using the query as and the columns of the view may be specified using the column-list parameter. The with-check-option is NIL by default but if it has a non-NIL value, then all insert/update commands on the view are checked to ensure that the new data satisfy the query as.
(create-view [lenins-group]
:as [select [first-name] [last-name] [email]
:from [employee]
:where [= [managerid] 1]])
=>
(select [*] :from [lenins-group])
=> (("Josef" "Stalin" "stalin@soviet.org")
("Leon" "Trotsky" "trotsky@soviet.org")
("Nikita" "Kruschev" "kruschev@soviet.org")
("Leonid" "Brezhnev" "brezhnev@soviet.org")
("Yuri" "Andropov" "andropov@soviet.org")
("Konstantin" "Chernenko" "chernenko@soviet.org")
("Mikhail" "Gorbachev" "gorbachev@soviet.org")
("Boris" "Yeltsin" "yeltsin@soviet.org")
("Vladamir" "Putin" "putin@soviet.org")),
("first_name" "last_name" "email")