Hi,
Trying to get trigger data persistent I thought why not just make a
table where I store the data.
The idea was that I could make it reference INFORMATION_SCHEMA.TRIGGERS
so that when a trigger is dropped
the related data would be dropped automatically too.
Here is my create table statement
CREATE TABLE IF NOT EXISTS PUBLIC.TRIGGER_DATA(
TRIGGER_SCHEMA VARCHAR NOT NULL,
TRIGGER_NAME VARCHAR NOT NULL,
NAME VARCHAR NOT NULL,
VALUE VARCHAR NOT NULL,
PRIMARY KEY(TRIGGER_SCHEMA, TRIGGER_NAME, NAME),
CONSTRAINT FK_TD FOREIGN KEY(TRIGGER_SCHEMA, TRIGGER_NAME)
REFERENCES INFORMATION_SCHEMA.TRIGGERS(TRIGGER_SCHEMA, TRIGGER_NAME) ON
DELETE CASCADE ON UPDATE CASCADE
);
But it seems this does not work. All I get is
General error: "java.lang.NullPointerException"
It would be handy if one could make foreign key references to tables in
information schema.
This way users could easily add more advanced features in the "user space".
Without poking around with the source code.
And another thing.
After receiving this exception I realized that the table was created,
only without the foreign key.
Now I know that there is a feature request for extending transactional
capabilities to DDL but shouldn't
a single create table statement be atomic, either fail or succeed?
And by the way are
ON DELETE CASCADE
and
ON UPDATE CASCADE
defaults if I don't mention them?
- rami
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.