Table name from StorageEvent
Posted: Fri Oct 11, 2019 10:19 am
Hi,
Can I somehow extract the name of the database table on which a StorageEvent happens?
In the following generic code I want to fill sTableName with that name
Thanks for your help.
Luc
Can I somehow extract the name of the database table on which a StorageEvent happens?
In the following generic code I want to fill sTableName with that name
- Code: Select all
public void doLog(StorageEvent pEvent) throws Exception
{
IBean oldRow = pEvent.getOld();
IBean newRow = pEvent.getNew();
Bean newLog = new Bean();
String sUser = TriggerAPI.getCurrentUserName();
Timestamp tTime = TriggerAPI.getCurrentTimestamp();
String sTableName = pEvent. ?????????????;
newLog.put("DBLOG_NEW", newRow.toString());
newLog.put("DBLOG_OLD", oldRow.toString());
newLog.put("SYS_CREATED_BY", sUser);
newLog.put("SYS_CREATED_ON", tTime);
newLog.put("TABLENAME", sTableName);
DBStorage dblog = getDblog();
dblog.insert(newLog);
}
Thanks for your help.
Luc