Difference between revisions of "DBUSED()"

From Lianjapedia
Jump to: navigation, search
m (1 revision: SQL)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to check whether a database is open.
 
Function to check whether a database is open.
 
  
 
==Syntax==
 
==Syntax==
 
DBUSED(<expC>)
 
DBUSED(<expC>)
 
  
 
==See Also==
 
==See Also==
 
[[ADATABASES()]], [[ADIR()]], [[ALIAS()]], [[CLOSE DATABASES]], [[COPY DATABASE]], [[DATABASE()]], [[DBF()]], [[DISPLAY SCHEMAS]], [[DISPLAY STATUS]], [[GETENV()]], [[LIST SCHEMAS]], [[LIST STATUS]], [[OPEN DATABASE]], [[SET FILECASE]], [[SET SQL]], [[USE]], [[USED()]]
 
[[ADATABASES()]], [[ADIR()]], [[ALIAS()]], [[CLOSE DATABASES]], [[COPY DATABASE]], [[DATABASE()]], [[DBF()]], [[DISPLAY SCHEMAS]], [[DISPLAY STATUS]], [[GETENV()]], [[LIST SCHEMAS]], [[LIST STATUS]], [[OPEN DATABASE]], [[SET FILECASE]], [[SET SQL]], [[USE]], [[USED()]]
 
  
 
==Description==
 
==Description==
 
The DBUSED() function is used to check whether the database whose name is specified in <expC> is open.  If the database is open, DBUSED() returns True (.T.), if not it returns False (.F.).
 
The DBUSED() function is used to check whether the database whose name is specified in <expC> is open.  If the database is open, DBUSED() returns True (.T.), if not it returns False (.F.).
 
NOTE: The DBUSED() 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==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
VFP/SQL> OPEN DATABASE hr EXCLUSIVE
+
open database hr exclusive
VFP/SQL> ? dbused("hr")
+
? dbused("hr")
 
.T.
 
.T.
VFP/SQL> CLOSE DATABASES
+
close databases
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:SQL]]
 
[[Category:SQL]]
[[Category:Databases]]
+
[[Category:Database Functions]]
[[Category:Databases Functions]]
+

Latest revision as of 12:15, 4 February 2013

Purpose

Function to check whether a database is open.

Syntax

DBUSED(<expC>)

See Also

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

Description

The DBUSED() function is used to check whether the database whose name is specified in <expC> is open. If the database is open, DBUSED() returns True (.T.), if not it returns False (.F.).

Example

open database hr exclusive
? dbused("hr")
.T.
close databases