DATABASE()

From Lianjapedia
Revision as of 12:26, 10 February 2012 by Yvonne.milne (Talk | contribs)

Jump to: navigation, search

Purpose

Function to return the name of the currently open database

Syntax

DATABASE()

See Also

ADATABASES(), ALIAS(), CLOSE DATABASES, DBF(), DBUSED(), DISPLAY SCHEMAS, DISPLAY STATUS, GETENV(), LIST SCHEMAS, 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 can be opened using the SQL USE command, with SQL set to MYSQL, or using the SQL OPEN DATABASE command.


Example

OPEN DATABASE hr
? database()
hr
CLOSE DATABASES