DBC AFTEROPENDATA

From Lianjapedia
Jump to: navigation, search

Purpose

Database events are triggered by certain database operations

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(), Lianja System Object, Lianja App Center Tiles, LIST DATABASE, LIST INDEXES, LIST TABLES, OPEN DATABASE, PACK DATABASE, REBUILD DATABASE, REINDEX DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, USE

Description

Databases are opened using the OPEN DATABASE <database-name> command. This triggers the DBC_OPENDATA database event, which confirms or cancels the open operation. The DBC_AFTEROPENDATA database event is triggered after the database has been opened.

The DBC_AFTEROPENDATA database event program can be used, for example, to load libraries or declare and initialize memory variables required before any tables are opened. It is especially useful when 'switching' database at runtime, using the Lianja.switchDatabase() method or App Tile custom App parameters.

Example

// Event: dbc_afteropendata
//
parameters cDatabase, cTable
 
if not function_exists("proc123")
	set procedure to proclib3 additive
endif
set date british
set dateformat to "dd/MM/yyyy"
 
if type("cEss1") = "U"
	public cEss1, cEss2, cEss3, cEss4
	store 0 to cEss1, cEss2, cEss3, cEss4
endif