Skip to content

Latest commit

 

History

History
60 lines (48 loc) · 1.57 KB

s4g846.md

File metadata and controls

60 lines (48 loc) · 1.57 KB

BeforeDropView, AfterDropView

These Database Events fire when a view is removed from a database, whether programmatically using the DELETE VIEW or DROP VIEW commands, or visually using the Database Designer.

Usage

PROCEDURE DBC_BeforeDropView( cViewName )

PROCEDURE DBC_AfterDropView( cViewName )

Parameter

Value

Meaning

cViewName

Character

The name of the view.

As with other before-and-after pairs of events, you can prevent a view from being removed by returning .F. in the BeforeDropView event, while the AfterDropView event is simply notified that a view was removed.

Example

* This goes in the stored procedures for a database.

PROCEDURE DBC_BeforeDropView(cViewName)
WAIT WINDOW PROGRAM() + CHR(13) + ;
    'cViewName: ' + cViewName

PROCEDURE DBC_AfterDropView(cViewName)
WAIT WINDOW PROGRAM() + CHR(13) + ;
    'cViewName: ' + cViewName

* End of stored procedures.
* Create a view, and then remove it.

CREATE SQL VIEW TestView AS SELECT * FROM CUSTOMER
DROP VIEW TestView

See Also

BeforeCreateView, Create SQL View, Database Events, Delete View, Drop View