This create table statement should be legal. I need to
create a hierarchical set of entities. As a workaround
I suppose I could modify the table after creation but
this shouldn't be necessary! Is this possible even?
How do I add a foreign key as an afterthought?
create cached table TNODE
(
ID INT IDENTITY PRIMARY KEY,
PARENT_ID INT,
NAME VARCHAR(64) NOT NULL,
FOREIGN KEY (PARENT_ID) REFERENCES TNODE(ID),
CONSTRAINT NAME UNIQUE(NAME, PARENT_ID)
);
java.sql.SQLException: Table not found: TNODE in
statement [create cached table TNODE
(
ID INT IDENTITY PRIMARY KEY,
PARENT_ID INT,
NAME VARCHAR(64) NOT NULL,
FOREIGN KEY (PARENT_ID) REFERENCES TNODE(ID),
CONSTRAINT NAME UNIQUE(NAME, PARENT_ID)
)]
at org.hsqldb.Trace.getError(Trace.java:180)
at org.hsqldb.jdbcResultSet.<init>
(jdbcResultSet.java:2645)
at org.hsqldb.jdbcConnection.executeStandalone
(jdbcConnection.java:994)
at org.hsqldb.jdbcConnection.execute
(jdbcConnection.java:721)
at org.hsqldb.jdbcStatement.fetchResult
(jdbcStatement.java:686)
at org.hsqldb.jdbcStatement.executeUpdate
(jdbcStatement.java:85)
at
com.borland.dx.sql.dataset.Database.executeStatement
(Unknown Source)
at com.borland.dbtools.jdbcx.sqlpanel.SqlBean.a
(Unknown Source)
at com.borland.dbtools.jdbcx.sqlpanel.SqlBean.a
(Unknown Source)
at com.borland.dbtools.jdbcx.sqlpanel.SqlBean.b
(Unknown Source)
at
com.borland.dbtools.jdbcx.sqlpanel.b.actionPerformed
(Unknown Source)
at
javax.swing.AbstractButton.fireActionPerformed
(AbstractButton.java:1450)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPe
rformed(AbstractButton.java:1504)
at
javax.swing.DefaultButtonModel.fireActionPerformed
(DefaultButtonModel.java:378)
at javax.swing.DefaultButtonModel.setPressed
(DefaultButtonModel.java:250)
at
javax.swing.plaf.basic.BasicButtonListener.mouseRelease
d(BasicButtonListener.java:216)
at java.awt.Component.processMouseEvent
(Component.java:3717)
at java.awt.Component.processEvent
(Component.java:3546)
at java.awt.Container.processEvent
(Container.java:1164)
at java.awt.Component.dispatchEventImpl
(Component.java:2595)
at java.awt.Container.dispatchEventImpl
(Container.java:1213)
at java.awt.Component.dispatchEvent
(Component.java:2499)
at
java.awt.LightweightDispatcher.retargetMouseEvent
(Container.java:2451)
at
java.awt.LightweightDispatcher.processMouseEvent
(Container.java:2216)
at java.awt.LightweightDispatcher.dispatchEvent
(Container.java:2125)
at java.awt.Container.dispatchEventImpl
(Container.java:1200)
at java.awt.Window.dispatchEventImpl
(Window.java:912)
at java.awt.Component.dispatchEvent
(Component.java:2499)
at java.awt.EventQueue.dispatchEvent
(EventQueue.java:319)
at java.awt.EventDispatchThread.pumpOneEvent
(EventDispatchThread.java:103)
at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run
(EventDispatchThread.java:84)
Logged In: NO
This project is defunct...post in the BugTracker at
http://sourceforge.net/projects/hsqldb