Name

CREATE-VIEW-FROM-CLASS — Create a SQL table from a View Class.Function

Syntax

      create-view-from-class view-class-name &key database transactions => 

Arguments and Values

view-class-name

The name of a View Class that has been defined with def-view-class.

database

The database in which to create the SQL table. This will default to the value of *default-database*.

transactions

When NIL specifies that a table type which does not support transactions should be used.

Description

Creates a table as defined by the View Class view-class-name in database.

Examples

(def-view-class foo () ((a :type (string 80))))
=> #<Standard-Db-Class FOO {4807F7CD}>
(create-view-from-class 'foo)
=>
(list-tables)
=> ("FOO")
      

Side Effects

Causes a table to be created in the SQL database.

Affected by

Most SQL database systems will signal an error if a table creation is attempted when a table with the same name already exists. The SQL user, as specified in the database connection, must have sufficient permission for table creation.

Exceptional Situations

A condition will be signaled if the table can not be created in the SQL database.

See Also

def-view-class
drop-view-from-class

Notes

Currently, only MySQL supports transactionless tables. CLSQL provides the ability to create such tables for applications which would benefit from faster table access and do not require transaction support.

The case of the table name is determined by the type of the database. MySQL, for example, creates databases in upper-case while PostgreSQL uses lowercase.