SQL Language Reference / Procedures |
Attach a writer to a table.
SYS.ATTACH_WRITER ( IN SCHEMA_NAME VARCHAR(128) NOT NULL, IN TABLE_NAME VARCHAR(128) NOT NULL, IN FUNCTION_STRING VARCHAR() NOT NULL, IN IN-IT_INFO_STR VARCHAR(), IN SERVER_GROUPS VARCHAR() )
The writer should be an implementation of the EventCallback interface. The onEvent method of the implementation is invoked before an event (such as an insert, update or delete) occurs on the table. Only one writer can be attached to a table. If a writer is already attached to a table, then the new writer replaces the previous one.
The following code adds an example writer implementation to a table. Example Writer Implementation shows the writer code.
Connection conn = getConnection(); CallableStatement cs = conn .prepareCall("CALL SYS.ATTACH_WRITER(?,?,?,?,?)"); cs.setString(1, "test"); cs.setString(2, "table"); cs.setString(3, "testpackage.EventCallBackWriterImpl"); cs.setString(4, "emp.ftable:3"); cs.setString(5, null); cs.execute();