Difference between revisions of "CLOSE DATABASE"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Closes the currently open database | Closes the currently open database | ||
Line 8: | Line 4: | ||
==Syntax== | ==Syntax== | ||
− | CLOSE | + | CLOSE DATABASE [ALL] |
==See Also== | ==See Also== | ||
− | [[ADATABASES()]], [[ADD TABLE]], [[ALTER INDEX]], [[ALTER TABLE]], [[BACKUP DATABASE]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[DB_DATADIR]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[LIST DATABASE]], [[LIST INDEXES]], [[LIST TABLES]], [[OPEN DATABASE]], [[RESTORE DATABASE]], [ | + | [[ADATABASES()]], [[ADD TABLE]], [[ALTER INDEX]], [[ALTER TABLE]], [[BACKUP DATABASE]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[DB_DATADIR]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY SCHEMAS]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[LIST DATABASE]], [[LIST INDEXES]], [[LIST SCHEMAS]], [[LIST TABLES]], [[OPEN DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SET GATEWAY]], [[SQL USE|USE]] |
==Description== | ==Description== | ||
− | The CLOSE | + | The CLOSE DATABASE command closes the currently open database and its tables. If no database is currently open, all tables and their associated files are closed. |
− | Databases in Recital are implemented as directories containing files that correspond to the tables and associated files in the database. Operating System file protection can be applied individually to the files for added security. The directories are sub-directories of the Recital data directory. The environment variable | + | Databases in Recital are implemented as directories containing files that correspond to the tables and associated files in the database. Operating System file protection can be applied individually to the files for added security. The directories are sub-directories of the Recital data directory. The environment variable DB_DATADIR points to the current Recital data directory and can be queried using the GETENV() function. Files from other directories can be added to the database using the ADD TABLE command or via the database catalog and SET AUTOCATALOG functionality. |
− | CLOSE | + | CLOSE DATABASE does not close gateway sessions. The SET GATEWAY TO or CLOSE ALL commands can be used for this purpose. |
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | OPEN DATABASE hr EXCLUSIVE | |
− | + | SELECT staff_no, lastname from staff | |
− | + | CLOSE DATABASES | |
</code> | </code> | ||
− | |||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:SQL]] | [[Category:SQL]] | ||
+ | [[Category:Databases]] | ||
+ | [[Category:Databases Commands]] |
Latest revision as of 17:34, 22 December 2009
Purpose
Closes the currently open database
Syntax
CLOSE DATABASE [ALL]
See Also
ADATABASES(), ADD TABLE, ALTER INDEX, ALTER TABLE, BACKUP DATABASE, CLOSE TABLES, COMPILE DATABASE, COPY DATABASE, CREATE DATABASE, CREATE TABLE, CREATE INDEX, CREATE VIEW, DB_DATADIR, DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY SCHEMAS, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), LIST DATABASE, LIST INDEXES, LIST SCHEMAS, LIST TABLES, OPEN DATABASE, RESTORE DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, SET GATEWAY, USE
Description
The CLOSE DATABASE command closes the currently open database and its tables. If no database is currently open, all tables and their associated files are closed.
Databases in Recital are implemented as directories containing files that correspond to the tables and associated files in the database. Operating System file protection can be applied individually to the files for added security. The directories are sub-directories of the Recital data directory. The environment variable DB_DATADIR points to the current Recital data directory and can be queried using the GETENV() function. Files from other directories can be added to the database using the ADD TABLE command or via the database catalog and SET AUTOCATALOG functionality.
CLOSE DATABASE does not close gateway sessions. The SET GATEWAY TO or CLOSE ALL commands can be used for this purpose.
Example
OPEN DATABASE hr EXCLUSIVE SELECT staff_no, lastname from staff CLOSE DATABASES
Products
Recital Server, Recital