Loading ...
Sorry, an error occurred while loading the content.

primary key value for update

Expand Messages
  • Christian Dreier
    Dear all! During the update process I get the errormessage java.sql.SQLException: [xmldbmx] Primary Key Value not supplied for UPDATE . The filter file
    Message 1 of 2 , Dec 2, 2004
    • 0 Attachment
      Dear all!



      During the update process I get the errormessage java.sql.SQLException:
      [xmldbmx] "Primary Key Value not supplied for UPDATE".

      The filter file exactly selects one element containing its primary key
      value. When I try to update this element, I receive this error message.

      I couldn't find out where this primary key value should be supplied.





      my mapping only defines one element named Part (in the mapping, IDNUMBER is
      defined as primary key, which is mapped to PartNumber)



      My filter file is as follows:



      <FilterSet Version="2.0"
      xmlns="http://www.xmlmiddleware.org/xmldbms/filters/v2">

      <Options>

      <Wrapper Name="RESULT"/>

      </Options>

      <Filters>

      <Filter>

      <RootFilter>

      <Table Name="PARTS"/>

      <Where Condition="IDNUMBER=1"/>

      </RootFilter>

      </Filter>

      </Filters>

      </FilterSet>



      The publishing then return the following:



      <RESULT>

      <Part>

      <Description>PC</Description>

      <PartNumber>1</PartNumber> <!-- this is the primary key -->

      <Price>1.000</Price>

      </Part>

      </RESULT>



      My action file is as follows:



      <Actions Version="2.0"
      xmlns="http://www.xmlmiddleware.org/xmldbms/actions/v2">

      <DefaultAction>

      <None/>

      </DefaultAction>

      <Action>

      <ElementType Name="Part"/>

      <Update>

      <ElementType Name="Description"/>

      </Update>

      </Action>

      </Actions>



      My XML-Input file, which contains the updated Information is the following:



      <Part>

      <Description>PC updated</Description>

      <PartNumber>1</PartNumber>

      <Price>1.000</Price>

      </Part>



      I know that the element to be updated must be exactly identify, but I think
      this is done by the filter (with the =1 condition)



      Hope that anybody can tell me where to supply/specify the primary key value!

      Thanks in advance,

      regards, Christian



      [Non-text portions of this message have been removed]
    • Ronald Bourret
      You need to specify the elements / attributes that are mapped to the primary key in your action document as items to be udpated. In your case, this means
      Message 2 of 2 , Dec 2, 2004
      • 0 Attachment
        You need to specify the elements / attributes that are mapped to the
        primary key in your action document as items to be udpated. In your
        case, this means changing your action document to the following:

        ...
        <Action>
        <ElementType Name="Part"/>
        <Update>
        <ElementType Name="PartNumber"/>
        <ElementType Name="Description"/>
        </Update>
        </Action>
        ...

        This is a design bug, as the primary key isn't updated. Worse yet, it
        isn't even documented :(

        -- Ron

        Christian Dreier wrote:

        > Dear all!
        >
        >
        >
        > During the update process I get the errormessage java.sql.SQLException:
        > [xmldbmx] "Primary Key Value not supplied for UPDATE".
        >
        > The filter file exactly selects one element containing its primary key
        > value. When I try to update this element, I receive this error message.
        >
        > I couldn't find out where this primary key value should be supplied.
        >
        > my mapping only defines one element named Part (in the mapping, IDNUMBER is
        > defined as primary key, which is mapped to PartNumber)
        >
        > My filter file is as follows:
        >
        > <FilterSet Version="2.0"
        > xmlns="http://www.xmlmiddleware.org/xmldbms/filters/v2">
        >
        > <Options>
        > <Wrapper Name="RESULT"/>
        > </Options>
        > <Filters>
        > <Filter>
        > <RootFilter>
        > <Table Name="PARTS"/>
        > <Where Condition="IDNUMBER=1"/>
        > </RootFilter>
        > </Filter>
        > </Filters>
        > </FilterSet>
        >
        > The publishing then return the following:
        >
        > <RESULT>
        > <Part>
        > <Description>PC</Description>
        > <PartNumber>1</PartNumber> <!-- this is the primary key -->
        > <Price>1.000</Price>
        > </Part>
        > </RESULT>
        >
        > My action file is as follows:
        >
        > <Actions Version="2.0"
        > xmlns="http://www.xmlmiddleware.org/xmldbms/actions/v2">
        > <DefaultAction>
        > <None/>
        > </DefaultAction>
        > <Action>
        > <ElementType Name="Part"/>
        > <Update>
        > <ElementType Name="Description"/>
        > </Update>
        > </Action>
        > </Actions>
        >
        > My XML-Input file, which contains the updated Information is the following:
        >
        > <Part>
        > <Description>PC updated</Description>
        > <PartNumber>1</PartNumber>
        > <Price>1.000</Price>
        > </Part>
        >
        > I know that the element to be updated must be exactly identify, but I think
        > this is done by the filter (with the =1 condition)
        >
        > Hope that anybody can tell me where to supply/specify the primary key value!
      Your message has been successfully submitted and would be delivered to recipients shortly.