473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

identity constraint not declared

19
hi,
i'm getting a warning which says that identity constraint is not declared in the <keyref > tag.

Can any1 pls help?
thanks in advance.

part of the xml schema :-

<xsd:key name = "PK_CounterParty">
<xsd:selecter xpath =".//Counter_Party_CID"/>
<xsd:field xpath = "CompID"/>
</xsd:key>

<xsd:keyref name = "CounterParty_CPID" refer="PK_CounterParty">
<xsd:selecter xpath =".//Counter_Party"/>
<xsd:field xpath = "CPID"/>
</xsd:keyref>
Nov 6 '08 #1
4 3216
Dormilich
8,658 Expert Mod 8TB
just a note: ".//element" is a very strange xpath. do you mean "./element" (child) or "//element" (any element)?

<selecter> is not a valid Schema element (it's <selector>)

regards
Nov 6 '08 #2
popprem
19
This is my schema.
I get the identity constraint not declared warning in <keyref>s.
Can u pls check wt hv i done wrng?
Thanks in advance.
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  4.  
  5.   <xsd:element name="fix">
  6.  
  7.     <xsd:complexType>
  8.  
  9.       <xsd:sequence>
  10.  
  11.         <xsd:element name="CounterParty" type="Counter_Party" minOccurs="1" maxOccurs="unbounded">
  12.  
  13.           <xsd:key name="PK_CounterParty" >
  14.  
  15.             <xsd:selector xpath=".//CounterParty" />
  16.  
  17.             <xsd:field xpath="CPID" />
  18.  
  19.           </xsd:key>
  20.  
  21.         </xsd:element>
  22.  
  23.       </xsd:sequence>
  24.  
  25.     </xsd:complexType>
  26.  
  27.   </xsd:element>
  28.  
  29.  
  30.  
  31.   <xsd:complexType name="Counter_Party">
  32.  
  33.     <xsd:sequence>
  34.  
  35.       <xsd:element name="CPID" type="xsd:int" />
  36.  
  37.       <xsd:element name="CPCode" type="xsd:string" />
  38.  
  39.       <xsd:element name="CPName" type="xsd:string" />
  40.  
  41.       <xsd:element name="CPType" type="xsd:string" />
  42.  
  43.       <xsd:element name="CPAddress" type="xsd:string" />
  44.  
  45.       <xsd:element name="CPTPNo" type="xsd:string" />
  46.  
  47.       <xsd:element name="CPContactPerson" type="xsd:string" />
  48.  
  49.       <xsd:element name="Status" type="xsd:string" />
  50.  
  51.       <xsd:element name="CreatedBy" type="xsd:string" />
  52.  
  53.       <xsd:element name="CreatedDate" type="xsd:date" />
  54.  
  55.       <xsd:element name="ModifiedBy" type="xsd:string" />
  56.  
  57.       <xsd:element name="ModifiedDate" type="xsd:date" />
  58.  
  59.       <xsd:element name="CounterPartyCID" type="Counter_Party_CID" minOccurs="2" maxOccurs="unbounded">
  60.  
  61.         <xsd:key name="PK_CounterPartyCID">
  62.  
  63.           <xsd:selector xpath=".//CounterPartyCID" />
  64.  
  65.           <xsd:field xpath="CompID" />
  66.  
  67.         </xsd:key>
  68.  
  69.         <xsd:keyref name="CounterParty_CPID" refer="PK_CounterParty" >
  70.  
  71.           <xsd:selector xpath=".//CounterParty" />
  72.  
  73.           <xsd:field xpath="@CPID" />
  74.  
  75.         </xsd:keyref>
  76.  
  77.       </xsd:element>
  78.  
  79.     </xsd:sequence>
  80.  
  81.   </xsd:complexType>
  82.  
  83.  
  84.  
  85.   <xsd:complexType name="Counter_Party_CID">
  86.  
  87.     <xsd:sequence>
  88.  
  89.       <xsd:element name="CompID" type="xsd:int" />
  90.  
  91.       <xsd:element name="MainComp" type="xsd:string" />
  92.  
  93.       <xsd:element name="SubComp" type="xsd:string" />
  94.  
  95.       <xsd:element name="CPID" type="xsd:string" />
  96.  
  97.       <xsd:element name="Host" type="xsd:string" />
  98.  
  99.       <xsd:element name="Port" type="xsd:int" />
  100.  
  101.       <xsd:element name="STBHost" type="xsd:string" />
  102.  
  103.       <xsd:element name="STBPort" type="xsd:int" />
  104.  
  105.       <xsd:element name="Status" type="xsd:string" />
  106.  
  107.       <xsd:element name="CreatedBy" type="xsd:string" />
  108.  
  109.       <xsd:element name="CreatedDate" type="xsd:date" />
  110.  
  111.       <xsd:element name="ModifiedBy" type="xsd:string" />
  112.  
  113.       <xsd:element name="ModifiedDate" type="xsd:date" />
  114.  
  115.       <xsd:element name="Session" type="Session_Detail" minOccurs="1" maxOccurs="unbounded">
  116.  
  117.         <xsd:key name="PK_Session">
  118.  
  119.           <xsd:selector xpath=".//Session_Detail" />
  120.  
  121.           <xsd:field xpath="SessionID" />
  122.  
  123.         </xsd:key>
  124.  
  125.         <xsd:keyref name="SessionCounterParty" refer="PK_CounterPartyCID">
  126.  
  127.           <xsd:selector xpath=".//Counter_Party_CID" />
  128.  
  129.           <xsd:field xpath="CompID" />
  130.  
  131.         </xsd:keyref>
  132.  
  133.       </xsd:element>
  134.  
  135.     </xsd:sequence>
  136.  
  137.  
  138.  
  139.   </xsd:complexType>
  140.  
  141.  
  142.  
  143.   <xsd:complexType name="Session_Detail">
  144.  
  145.     <xsd:sequence>
  146.  
  147.       <xsd:element name="SessionID" type="xsd:int" />
  148.  
  149.       <xsd:element name="SessionCode" type="xsd:string" />
  150.  
  151.       <xsd:element name="InternalComp" type="xsd:int" />
  152.  
  153.       <xsd:element name="ExternalComp" type="xsd:int" />
  154.  
  155.       <xsd:element name="InitiatorSide" type="xsd:string" />
  156.  
  157.       <xsd:element name="Status" type="xsd:string" />
  158.  
  159.       <xsd:element name="CreatedBy" type="xsd:string" />
  160.  
  161.       <xsd:element name="CreatedDate" type="xsd:date" />
  162.  
  163.       <xsd:element name="ModifiedBy" type="xsd:string" />
  164.  
  165.       <xsd:element name="ModifiedDate" type="xsd:date" />
  166.  
  167.       <xsd:element name="SessionProfile" type="Session_Profile" minOccurs="1" maxOccurs="1" />
  168.  
  169.     </xsd:sequence>
  170.  
  171.   </xsd:complexType>
  172.  
  173.  
  174.  
  175.   <xsd:complexType name="Session_Profile">
  176.  
  177.     <xsd:sequence>
  178.  
  179.       <xsd:element name="SessionID" type="xsd:int" />
  180.  
  181.       <xsd:element name="ProfileID" type="xsd:int" />
  182.  
  183.       <xsd:element name="Status" type="xsd:string" />
  184.  
  185.       <xsd:element name="CreatedBy" type="xsd:string" />
  186.  
  187.       <xsd:element name="CreatedDate" type="xsd:date" />
  188.  
  189.       <xsd:element name="ModifiedBy" type="xsd:string" />
  190.  
  191.       <xsd:element name="ModifiedDate" type="xsd:date" />
  192.  
  193.     </xsd:sequence>
  194.  
  195.   </xsd:complexType>
  196.  
  197. </schema>
  198.  
Nov 6 '08 #3
jkmyoung
2,057 Expert 2GB
Could be a namespace problem: eg:
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"

Would change that, and also use targetNamespace attribute.
Nov 6 '08 #4
popprem
19
Could be a namespace problem: eg:
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"

Would change that, and also use targetNamespace attribute.
thanks a lot.
I'l change those attributes.
Nov 10 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Rathtap | last post by:
I want to use the Identity field (increment 1,1) as a primary key and have a unique constraint on my other field which is of type char. I am worried that related data in other tables may lose...
112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
5
by: Eugene | last post by:
I have a table EugeneTest(id_num, fname, minit, lname) where field "id_num" is type IDENTITY and has UNIQUE constraint Let's say 2 user execute this code at the same time: DECLARE @return...
4
by: newtophp2000 | last post by:
We have a table that has an identity field along with 5 other domain fields. The identity field is not declared as a primary key. The table has 3.5 million records. A consultant was hired...
6
by: Who.Really.Really.Cares | last post by:
Hi! I guess this must be a FAQ but I'll give it a try. I've searched the web and usenet archive and found only negative answers. But most of them were dated like 3-4 years back. Hasn't anything...
41
by: pb648174 | last post by:
In a multi-user environment, I would like to get a list of Ids generated, similar to: declare @LastId int select @LastId = Max(Id) From TableMania INSERT INTO TableMania (ColumnA, ColumnB)...
5
by: Veeru71 | last post by:
Given a table with an identity column (GENERATED BY DEFAULT AS IDENTITY), is there any way to get the last generated value by DB2 for the identity column? I can't use identity_val_local() as...
15
by: gunnar.sigurjonsson | last post by:
I´m having some problem retrieving identity value from my newly inserted row into a view. I have two tables T1 and T2 which I define as following CREATE TABLE T1 ( id BIGINT GENERATED ALWAYS...
0
by: Frank Swarbrick | last post by:
So we're trying to decide if it's better to use IDENTITY columns or sequences to create a surrogate key as the primary key for our tables. I kind of like the identity column, because it's more...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.