Difference between revisions of "DBC OPENDATA"

From Lianjapedia
Jump to: navigation, search
m (Text replace - "Recital" to "Lianja")
Line 20: Line 20:
  
 
==See Also==
 
==See Also==
[[ADATABASES()]], [[ALTER TABLE]], [[ADD TABLE]], [[ALTER INDEX]], [[BACKUP DATABASE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[DATABASE()]], [[SQL Database Events|DATABASE EVENTS]], [[DB_DATADIR]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[LIST DATABASE]], [[LIST INDEXES]], [[LIST TABLES]], [[OPEN DATABASE]], [[PACK DATABASE]], [[REBUILD DATABASE]], [[REINDEX DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]]
+
[[ADATABASES()]], [[ALTER TABLE]], [[ADD TABLE]], [[ALTER INDEX]], [[BACKUP DATABASE]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[CREATE DATABASE]], [[CREATE TABLE]], [[CREATE INDEX]], [[CREATE VIEW]], [[DATABASE()]], [[SQL Database Events|DATABASE EVENTS]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[LIST DATABASE]], [[LIST INDEXES]], [[LIST TABLES]], [[OPEN DATABASE]], [[PACK DATABASE]], [[REBUILD DATABASE]], [[REINDEX DATABASE]], [[RESTORE DATABASE]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]]
  
 
==Description==
 
==Description==
Line 40: Line 40:
 
|}
 
|}
  
Databases in Lianja 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 Lianja data directory.  The environment variable DB_DATADIR points to the current Lianja 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.
+
Programs associated with database events should reside in the database's directory.
 
+
Programs associated with database events should reside in the DB_DATADIR sub-directory for the relevant database.
+
  
 
==Example==
 
==Example==

Revision as of 12:36, 19 December 2012

Purpose

Database events are triggered by certain database operations

Syntax

PROCEDURE dbc_OpenData(<expC>,<expL1>,<expL2>,<expL3>)

// Commands

ENDPROC | RETURN [<expL4>]

or

PROCEDURE dbc_OpenData

LPARAMETERS [<expC>,<expL>,<expL2>,<expL3>]

// Commands

ENDPROC | RETURN [<expL4>]

See Also

ADATABASES(), ALTER TABLE, ADD TABLE, ALTER INDEX, BACKUP DATABASE, CLOSE DATABASES, CLOSE TABLES, COMPILE DATABASE, CREATE DATABASE, CREATE TABLE, CREATE INDEX, CREATE VIEW, DATABASE(), DATABASE EVENTS, DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), LIST DATABASE, LIST INDEXES, LIST TABLES, OPEN DATABASE, PACK DATABASE, REBUILD DATABASE, REINDEX DATABASE, RESTORE DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, USE

Description

The DBC_OPENDATA database event is triggered when a database is opened. The associated code is run before the database is actually opened. Databases are opened using the OPEN DATABASE <database-name> command.

Event Description
<expC> The database name
<expL1> Specifies whether the database is being opened exclusively, .T. or shared, .F.
<expL2> Specifies whether the NOPUDATE keyword was included on the OPEN DATABASE command, .T. or not, .F.
<expL3> Specifies whether the VALIDATE keyword was included on the OPEN DATABASE command, .T. or not, .F.
<expL4> If the dbc_opendata procedure returns .F., the database is not opened, if .T., the open operation continues

Programs associated with database events should reside in the database's directory.

Example

procedure dbc_opendata
lparameters cName, lExcl, lRo, lValidate
set procedure to proclib1, proclib2 additive
return