Difference between revisions of "DBC CLOSEDATA"
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Database event triggered by the closure of a database | Database event triggered by the closure of a database | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==See Also== | ==See Also== | ||
− | [[ADATABASES()]], [[ALTER TABLE]], [[ADD TABLE]], [[ALTER INDEX | + | [[ADATABASES()]], [[ALTER TABLE]], [[ADD TABLE]], [[ALTER INDEX]], [[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]], [[SET AUTOCATALOG]], [[SET EXCLUSIVE]], [[SQL USE|USE]] |
==Description== | ==Description== | ||
− | The DBC_CLOSEDATA database event is triggered by the closure of a database. The | + | The DBC_CLOSEDATA database event is triggered by the closure of a database and runs dbc_closedata.prg (.dbo compiled/runtime) if it exists. The code is run before the database is actually closed. Databases are closed using the CLOSE DATABASES command. |
− | {| class="wikitable" | + | The following parameters are passed to the dbc_closedata program: |
− | ! | + | |
+ | {| class="wikitable" width="100%" | ||
+ | !Parameter||Description | ||
|- | |- | ||
|<expC>||The database name | |<expC>||The database name | ||
|- | |- | ||
− | |<expL1>||Specifies whether the ALL keyword was included on the CLOSE DATABASES, .T. or not, .F. | + | |valign="top"|<expL1>||Specifies whether the ALL keyword was included on the CLOSE DATABASES command, .T. or not, .F. |
− | + | ||
− | + | ||
|- | |- | ||
|} | |} | ||
− | Programs associated with database events should reside in the database's directory. | + | If the dbc_closedata program returns .F., the database is not closed, if .T., the close operation continues. |
+ | |||
+ | Programs associated with database events should reside in the database's directory. These can be created and modified from the [[Database Events|Events tab in the Data Workspace]] when a database is open. | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | // dbc_closedata.prg | |
lparameters cName, lAll | lparameters cName, lAll | ||
close procedures | close procedures | ||
Line 49: | Line 34: | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:SQL]] | [[Category:SQL]] | ||
+ | [[Category:Databases]] |
Latest revision as of 06:14, 17 October 2016
Contents
Purpose
Database event triggered by the closure of a database
See Also
ADATABASES(), ALTER TABLE, ADD TABLE, ALTER INDEX, 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, SET AUTOCATALOG, SET EXCLUSIVE, USE
Description
The DBC_CLOSEDATA database event is triggered by the closure of a database and runs dbc_closedata.prg (.dbo compiled/runtime) if it exists. The code is run before the database is actually closed. Databases are closed using the CLOSE DATABASES command.
The following parameters are passed to the dbc_closedata program:
Parameter | Description |
---|---|
<expC> | The database name |
<expL1> | Specifies whether the ALL keyword was included on the CLOSE DATABASES command, .T. or not, .F. |
If the dbc_closedata program returns .F., the database is not closed, if .T., the close operation continues.
Programs associated with database events should reside in the database's directory. These can be created and modified from the Events tab in the Data Workspace when a database is open.
Example
// dbc_closedata.prg lparameters cName, lAll close procedures return