Difference between revisions of "ADATABASES()"
Yvonnemilne (Talk | contribs) (→See Also) |
Helengeorge (Talk | contribs) (→Products) |
||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Function to place the names of all open databases and their paths into a variable array. | Function to place the names of all open databases and their paths into a variable array. | ||
Line 10: | Line 8: | ||
==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]], [[COPY DATABASE]], [[DATABASE()]], [[DBF()]], [[DBUSED()]], [[DISPLAY SCHEMAS]], [[DISPLAY STATUS]], [[GETENV()]], [[LIST SCHEMAS]], [[LIST STATUS]], [[OPEN DATABASE]], [[SET SQL]], [[SQL USE|USE]], [[USED()]] |
+ | |||
==Description== | ==Description== | ||
Line 33: | Line 32: | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Latest revision as of 15:45, 26 November 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, COPY DATABASE, 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 Server, Recital