Unique Constraint over multiple table
Thorsten <[email protected]> Wed, 30 Nov 2022 15:36:28 +0100
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============4635980384104998706==
Content-Type: multipart/alternative;
boundary="------------9X31HnY0zLTfS2TZlBwXfGJZ"
This is a multi-part message in MIME format.
--------------9X31HnY0zLTfS2TZlBwXfGJZ
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hello.
I am interested in creating a unique constraint spanning multiple
tables. The internet suggests creating a view table and than creating a
unique for that view.
So I did
CREATE VIEW EV_KEY AS SELECT c.CMD_META_ID, d.DP_ID FROM PM_LINK_CMD as c JOIN PM_LINK_DP d on d.PM_LINK_ID=c.PM_LINK_ID
CREATE UNIQUE INDEX event_link ON EV_KEY(CMD_META_ID,DP_ID)
That aproach seems to be unsupported for HSQLDB. Is there a way to have
a unique constraint that joins multiple tables in hsqldb?
Best regards,
Thorsten Goetzke
--------------9X31HnY0zLTfS2TZlBwXfGJZ
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello.</p>
<p>I am interested in creating a unique constraint spanning multiple
tables. The internet suggests creating a view table and than
creating a unique for that view.</p>
<p>So I did <br>
</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9,8pt;">CREATE VIEW EV_KEY AS SELECT c.CMD_META_ID, d.DP_ID FROM PM_LINK_CMD as c JOIN PM_LINK_DP d on d.PM_LINK_ID=c.PM_LINK_ID
CREATE UNIQUE INDEX event_link ON EV_KEY(CMD_META_ID,DP_ID)</pre>
<p></p>
<p>That aproach seems to be unsupported for HSQLDB. Is there a way
to have a unique constraint that joins multiple tables in hsqldb?
<br>
</p>
<p>Best regards,</p>
<p>Thorsten Goetzke<br>
</p>
</body>
</html>
--------------9X31HnY0zLTfS2TZlBwXfGJZ--
--===============4635980384104998706==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============4635980384104998706==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Hsqldb-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
--===============4635980384104998706==--