Difference between revisions of "LIST DATABASE"

From Lianjapedia
Jump to: navigation, search
 
(Description)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
List information about the active database
 
List information about the active database
 
  
 
==Syntax==
 
==Syntax==
LIST DATABASE [TO FILE <.txt filename> | (<expC>)] | [TO PRINT]
+
LIST DATABASE [TO FILE <.txt filename> | (<expC>)]
 
+
  
 
==See Also==
 
==See Also==
[[ADATABASES()]], [[ALTER INDEX]], [[ALTER TABLE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY DATABASE]], [[CREATE DATABASE]], [[CREATE INDEX]], [[CREATE TABLE]], [[CREATE VIEW]], [[DB_DATADIR]], [[DB_PRINT]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY SCHEMAS]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[LIST INDEXES]], [[LIST SCHEMAS]], [[LIST TABLES]], [[OPEN DATABASE]], [[SET EXCLUSIVE]], [[SET PAGELENGTH]], [[SET PAGEWIDTH]], [[SET PRINTER]], [[SQL USE|USE]]   
+
[[ADATABASES()]], [[ALTER INDEX]], [[ALTER TABLE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY DATABASE]], [[CREATE DATABASE]], [[CREATE INDEX]], [[CREATE TABLE]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY SCHEMAS]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[LIST INDEXES]], [[LIST SCHEMAS]], [[LIST TABLES]], [[OPEN DATABASE]], [[SET EXCLUSIVE]], [[SQL USE|USE]]   
  
 
==Description==
 
==Description==
 
The LIST DATABASE command is used to display information about the currently active database.   
 
The LIST DATABASE command is used to display information about the currently active database.   
  
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 are opened using the OPEN DATABASE command.
+
Databases are opened using the OPEN DATABASE command.
  
 
The LIST DATABASE command displays the following information:
 
The LIST DATABASE command displays the following information:
  
 
* Database Name, e.g. southwind
 
* Database Name, e.g. southwind
* Database Path, e.g. /usr/recital/data/southwind
+
* Database Path, e.g. C:\lianja\data\southwind\
 +
* Database MetaData
  
 
and for each table in the database the equivalent of LIST STRUCTURE INDEX followed by LIST DICTIONARY:
 
and for each table in the database the equivalent of LIST STRUCTURE INDEX followed by LIST DICTIONARY:
Line 32: Line 31:
 
* Index tag names, keys, types and lengths
 
* Index tag names, keys, types and lengths
 
* Dictionary information
 
* Dictionary information
 +
* Table MetaData
  
 
+
{| class="wikitable" width="100%"
{| class="wikitable"
+
!width="20%"|Keyword||Description
!Keyword||Description
+
|-
+
|TO <file>||The display output will be sent to the specified file.  The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename.  If no file extension is specified, then ".txt" will be used.  The command SET PAGELENGTH governs the output file pagination and SET PAGEWIDTH defines the width of each page.  Page numbers are centered on the bottom of the page according to width.
+
 
|-
 
|-
|TO PRINT||The display output will be sent to a printer.  The TO PRINT option will default to a local printer unless the command SET PRINTER TO \\SPOOLER is issued. The print request will then be spooled to the system printer, which is defined by the environment variable DB_PRINT.
+
|valign="top"|TO <file>||The display output will be sent to the specified file.  The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename.  If no file extension is specified, then ".txt" will be used.
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
VFP/SQL > OPEN DATABASE southwind
+
OPEN DATABASE southwind
VFP/SQL > LIST DATABASE
+
LIST DATABASE
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 
[[Category:SQL]]
 
[[Category:SQL]]
 
[[Category:Databases]]
 
[[Category:Databases]]
[[Category:Databases Commands]]
 

Latest revision as of 03:40, 15 December 2017

Purpose

List information about the active database

Syntax

LIST DATABASE [TO FILE <.txt filename> | (<expC>)]

See Also

ADATABASES(), ALTER INDEX, ALTER TABLE, CLOSE DATABASES, CLOSE TABLES, COMPILE DATABASE, COPY DATABASE, CREATE DATABASE, CREATE INDEX, CREATE TABLE, DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY SCHEMAS, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), LIST INDEXES, LIST SCHEMAS, LIST TABLES, OPEN DATABASE, SET EXCLUSIVE, USE

Description

The LIST DATABASE command is used to display information about the currently active database.

Databases are opened using the OPEN DATABASE command.

The LIST DATABASE command displays the following information:

  • Database Name, e.g. southwind
  • Database Path, e.g. C:\lianja\data\southwind\
  • Database MetaData

and for each table in the database the equivalent of LIST STRUCTURE INDEX followed by LIST DICTIONARY:

  • Table file name
  • Number of records
  • Date of creation
  • Date of last update
  • Encryption status
  • Field names, types, sizes and description
  • Total record length
  • Production DBX file name
  • Index tag names, keys, types and lengths
  • Dictionary information
  • Table MetaData
Keyword Description
TO <file> The display output will be sent to the specified file. The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. If no file extension is specified, then ".txt" will be used.

Example

OPEN DATABASE southwind
LIST DATABASE