Difference between revisions of "ADATABASES()"
Yvonnemilne (Talk | contribs) (→See Also) |
Yvonnemilne (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | |||
==Purpose== | ==Purpose== | ||
Line 11: | Line 10: | ||
==See Also== | ==See Also== | ||
[[ADIR()]], [[ALIAS()]], [[CLOSE DATABASES]], [[DATABASE()]], [[DBF()]], [[DBUSED()]], [[DISPLAY SCHEMAS]], [[DISPLAY STATUS]], [[GETENV()]], [[LIST SCHEMAS]], [[LIST STATUS]], [[OPEN DATABASE]], [[SET SQL]], [[SQL USE|USE]], [[USED()]] | [[ADIR()]], [[ALIAS()]], [[CLOSE DATABASES]], [[DATABASE()]], [[DBF()]], [[DBUSED()]], [[DISPLAY SCHEMAS]], [[DISPLAY STATUS]], [[GETENV()]], [[LIST SCHEMAS]], [[LIST STATUS]], [[OPEN DATABASE]], [[SET SQL]], [[SQL USE|USE]], [[USED()]] | ||
+ | |||
==Description== | ==Description== |
Revision as of 14:49, 30 October 2009
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, DATABASE(), 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.
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 EXCLUSIVE VFP/SQL> nDatabases = adatabases(aDBCNames) VFP/SQL> CLOSE DATABASES
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer