From: <td...@te...> - 2004-04-24 12:41:35
|
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! |