Originally posted by Petrus
Maybe I'm in the wrong, but I would like to compare references or OID, not columns values... How using REFERENCING can help ?
You are right, your issue is not helped by adding a REFERENCING clause.
As for what the answer actually is, I have no idea. I have never created a table using REF and I never intend to. Apart from making it harder to query the database (and to write triggers), what does it do for you?
If the table was built using good old relational methods, you wouldn't even need the trigger, you would create a foreign key.
Indeed, it's not an obligation to use object table, but references are abstraction for forein keys, although they are sometimes harder to manage...
For example you can write :
FROM Personns p
WHERE p.adress.town.name LIKE 'xx';
where town is an attribute of adress, which is an attribute of personn.
That is also useful when you're using JPublisher which automaticly generates the java classes corresponding to the database objects.
FinallyI "solve" my problem by adding an attribute into the B_t object :
mySelf REF B_t;
which is initialized at the creation :
UPDATE B b SET b.mySelf = REF(b)
The trigger is now :
CREATE TRIGGER xx BEFORE DELETE ON B
FROM A a
WHERE (a.refB = ld.mySelf);