Difference between revisions of "ADATABASES()"

From Lianjapedia
Jump to: navigation, search
Line 6: Line 6:
  
 
==See Also==
 
==See Also==
[[ADIR()]], [[ALIAS()]], [[CLOSE DATABASES]], [[COPY DATABASE]], [[DATABASE()]], [[DBF()]], [[DBUSED()]], [[DISPLAY SCHEMAS]], [[DISPLAY STATUS]], [[GETENV()]], [[LIST SCHEMAS]], [[LIST STATUS]], [[OPEN DATABASE]], [[SET SQL]], [[SQL USE|USE]], [[USED()]]
+
[[ADIR()]], [[ALIAS()]], [[CLOSE DATABASES]], [[COPY DATABASE]], [[DATABASE()]], [[DBC()]], [[DBF()]], [[DBUSED()]], [[DISPLAY SCHEMAS]], [[DISPLAY STATUS]], [[GETENV()]], [[LIST SCHEMAS]], [[LIST STATUS]], [[OPEN DATABASE]], [[SET SQL]], [[SQL USE|USE]], [[USED()]]
  
 
==Description==
 
==Description==
Line 14: Line 14:
  
 
NOTE: The ADATABASES() function operates on databases, not tables.
 
NOTE: The ADATABASES() function operates on databases, not tables.
 
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 data directory.  The environment variable / symbol DB_DATADIR points to the current 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==
 
==Example==

Revision as of 07:51, 2 October 2012

Purpose

Function to place the names of all open databases and their paths into a variable array.

Syntax

ADATABASES(<array>)

See Also

ADIR(), ALIAS(), CLOSE DATABASES, COPY DATABASE, DATABASE(), DBC(), DBF(), DBUSED(), DISPLAY SCHEMAS, DISPLAY STATUS, GETENV(), LIST SCHEMAS, LIST STATUS, OPEN DATABASE, SET SQL, USE, USED()

Description

The ADATABASES() function is used to place the names of all open databases and their paths into a variable array. The name if the array is specified in <array>. If the array does not exist, it is created. If the array is smaller or larger than required, it is resized. The array is two-dimensional with two columns. The first column contains the name of an open database, the second the path for that database.

The ADATABASES() function returns the number of database names added to the array. If no databases are open or the array cannot be created, the ADATABASES() function returns 0.

NOTE: The ADATABASES() function operates on databases, not tables.

Example

OPEN DATABASE hr EXCLUSIVE
nDatabases = adatabases(aDBCNames)
CLOSE DATABASES