reference in same table
Tomasz Dreßler <[email protected]> Sat, 24 Apr 2004 14:41:29 +0200
| Newsgroups | gmane.comp.lib.sql.sqlpp |
|---|---|
| Message-ID | <[email protected]> |
Hi!
Can I implement a reference from a foreign key to a primary key field
in the same table?
I try the something like this:
<table id="users" name="Users" field-prefix="User" qualifier="test_"
fixed="false" signed="false" suffix="">
<field id="userid" name="ID" type="int" primary-key="true" />
<!-- <field id="bossid" name="bossID" type="int" /> -->
<field id="username" name="Name" type="NVARCHAR(30)"
nullable="false" />
<field id="userlastname" name="LastName" type="NVARCHAR(30)"
nullable="true" />
<reference id="ref_myBoss" ref-table="users" field-prefix=""
nullable="false" match="userid" name="bossid" />
<!-- <reference id="ref_myBoss" ref-table="users"
field-prefix="" nullable="false" name="bossid"/> -->
</table>
but I get error that a "duplicate field name while creating foreign
keys" was found.
Could you help me?
What make the match and name attribute in reference-type tag exactly?
Thank you!
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297