DATABASE()

From Recital Documentation Wiki
Revision as of 16:53, 23 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Class

Databases


Purpose

Function to return the name of the currently open database


Syntax

DATABASE()


See Also

ADATABASES(), ALIAS(), CLOSE DATABASES, DBF(), DBUSED(), DISPLAY STATUS, GETENV(), LIST STATUS, OPEN DATABASE, SET FILECASE, SET SQL, USE, USED()


Description

The DATABASE() function returns the name of the currently open database or a null string if none is open.

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 / symbol 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.

Databases can be opened using the SQL USE command, with SQL set to MYSQL, or using the SQL OPEN DATABASE command.


Example

VFP/SQL> OPEN DATABASE hr
VFP/SQL> ? database()
hr
VFP/SQL> CLOSE DATABASES


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer