How to interpret trigger meta data?
Hi,
when querying for trigger meta data, e.g. issuing
SELECT * FROM db_trigger
strange codes are returned for db_trigger.owner (e.g. @140|1|0) and target_class (e.g. @523|8|0). What do they mean?
And more important: How to find out which class/table name the trigger relates to?
Regards, Volker.
The values that you're getting are object identifiers (OID). CUBRID is an object-relational database. All tables in CUBRID are classes and they can be inherited or can inherit from other classes, also you can aggregate tables. The owner column from db_trigger is an object of type db_user (the table db_user) and the value that you're seeing there is the OID (object identifier).
For your actual question, the schema of the class db_trigger is described here:
http://www.cubrid.org/manual/841/en/db_trigger
It has two object columns:
- the field owner is an object of type db_user
- the field target_class is an actual class
SELECT * FROM db_trigger where target_class = class x;
If you want to get the name of the owner (the user) of the trigger, you can run the query:
SELECT owner.name from db_trigger where target_class = class x;
You can find all the names of the tables which have triggers, you have to join db_trigger class with _db_class class
SELECT c.class_name FROM _db_class c inner join db_trigger t ON t.target_class = c.class_of
See also:
http://www.cubrid.org/manual/821/en/Class%20Inheritance
and