Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register


2
(click on this box to dismiss)

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.

link comment (0)
asked 2 years ago
vbergmann
31
17 Answers
1

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
If you want to find out what triggers are defined on class 'x' you can run the query:
 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

http://www.cubrid.org/questions/318023

link comment (0)
answered 2 years ago
ginarrbrik
516
tagged




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: