<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2>Not knowing the exact data content and record structures 
make this a series of guesses.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2>First off, the message is very specific. You are attempting 
to add the same record more than once. The fact that you have only one record in 
the subfile may be beside the point since that data will be duplicated for each 
record complex.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2>Saying SORTED does not guarantee a proper sort sequence. 
QTP believes you, so if your actual data is not in the proper sequence, results 
may not be as expected. Do you get the same results if you use 
SORT?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2>I would suggest that you attempt to simplify the request. 
Your SORTED is quite complex. Is it really required? There are obviously other 
statements in the request. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2>You know what the linkitem value is that's causing the 
problem. Run the input and SORTED statements through QUIZ and select on that 
value so you can see how many record complexes are being constructed and what 
order they're in.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=625485012-30102007><FONT face=Arial 
color=#0000ff size=2>Bob</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> vamsi krishna 
  [mailto:vamsi.coe@gmail.com] <BR><B>Sent:</B> October 29, 2007 6:11 
  pm<BR><B>To:</B> Deskin, Bob<BR><B>Cc:</B> Guy Werry; 
  powerh-l@lists.sowder.com<BR><B>Subject:</B> Re: Yet Again, QTP Failure: 
  OUTPUT --&gt; ADD UPDATE<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV>Hello Bob,</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Here's the failure extract:</DIV>
  <DIV>
  <P><FONT face="courier new,monospace"><FONT size=1><STRONG>Attempt to add a 
  duplicate value when UNIQUE KEY/INDEX was specified.&nbsp;&nbsp; 
  [8182]<BR>&nbsp;&nbsp; File:&nbsp; SPOIINP1-UPD<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  Linkitem:&nbsp; 
  SPOIINP1-KEY</STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <FONT color=#ff0000>93169029301EURL</FONT></FONT></FONT></P>
  <P><FONT face="courier new,monospace"><FONT size=1><FONT color=#cc0000>Action 
  Taken: Run 
  terminated.<BR></FONT><STRONG>-------------------------------------------------------------------------------</STRONG></FONT></FONT> 
  </P>
  <P><STRONG><FONT face="courier new,monospace" size=1>Records read:<BR>&nbsp; 
  IPWSPRI2_S&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;&nbsp;&nbsp;&nbsp; 
  5,596</FONT></STRONG></P>
  <P><STRONG><FONT face="courier new,monospace" size=1>Transactions 
  processed:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  8,182</FONT></STRONG></P>
  <P><STRONG><FONT face="courier new,monospace" size=1>Records 
  processed:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Added&nbsp;&nbsp;&nbsp; Updated&nbsp; Unchanged&nbsp;&nbsp;&nbsp; 
  Deleted<BR>&nbsp; 
  SPOIINP1-UPD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  124&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  4,085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<BR>&nbsp; 
  PPMINSCP-UPD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  90&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  4,119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 <BR>&nbsp; 
  IPWSPRI3_S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0</FONT></STRONG></P>
  <P><STRONG><FONT face="courier new,monospace" 
  size=1>Finished.<BR></FONT></STRONG></P><BR><BR>And Here's the code 
part:</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2><FONT face="">
  <P><BR><BR><FONT face="courier new,monospace" size=1>ACCESS *$IPWSPRI2_S LINK 
  &amp;<BR>RJ(GM-PART) + &amp;<BR>TEMP-NSC + &amp;<BR>PRIC-LIST + 
  &amp;<BR>CURR-CODE +&amp;<BR>OUTLET_1 TO &amp;<BR>SPOIINP1-KEY OF SPOIINP1 
  OPTIONAL AND &amp; <BR>RJ(GM-PART) , &amp;<BR>TEMP-NSC , &amp;<BR>PRIC-LIST , 
  &amp;<BR>CURR-CODE TO &amp;<BR>GM-PART , &amp;<BR>NSC-CODE , 
  &amp;<BR>PRIC-LIST-NUM , &amp;<BR>PRIC-CURR OF PPMINSCP 
  OPTIONAL<BR><BR>TEMPORARY TEMP-UNIT INTEGER * 9 SIGNED SIZE 4 BYTES 
  <BR><BR>TEMPORARY TEMP-COST INTEGER * 16 SIGNED SIZE 8 BYTES<BR><BR>TEMPORARY 
  TEMP-VALU INTEGER * 16 SIGNED SIZE 8 BYTES<BR><BR>SORTED ON GM-PART OF 
  IPWSPRI2_S, &amp;<BR><BR>TEMP-NSC OF IPWSPRI2_S, &amp;<BR><BR>PRIC-LIST OF 
  IPWSPRI2_S, &amp; <BR><BR>CURR-CODE OF IPWSPRI2_S, &amp;<BR>OUTLET_1 OF 
  IPWSPRI2_S</FONT></P>
  <P><BR><FONT face="courier new,monospace" size=1>ITEM TEMP-UNIT SUBTOTAL 
  PART-QTY RESET AT OUTLET_1<BR>ITEM TEMP-COST SUBTOTAL PLAN-PRIC RESET AT 
  OUTLET_1 ;L0001<BR>ITEM TEMP-VALU SUBTOTAL NET-AMOU-LOC RESET AT OUTLET_1 
  ;L0001 </FONT></P>
  <P><BR><FONT face="courier new,monospace" size=1>OUTPUT SPOIINP1 ADD UPDATE 
  ALIAS SPOIINP1-UPD AT OUTLET_1 &amp;<BR>IF RECORD PPMINSCP EXIST<BR>ITEM 
  ................</FONT></P>
  <P>&nbsp;</P>
  <P>In the input subfile, there was only one record corresponding to Unique Key 
  value.</P></FONT>
  <P>But the data, which was attempted to add, it was exactly the same record 
  which existed in the file.</P>
  <P>So, Is there a possibility that it failed "while adding (unique key) 
  +updating record with same values" ??</P>
  <P>It's just a wild guess :-)</P>
  <P>Let me know if you need more details</P>
  <P>Regards,</P>
  <P>Vamsi</P></FONT></DIV>
  <DIV><SPAN class=gmail_quote>On 10/30/07, <B class=gmail_sendername>Deskin, 
  Bob</B> &lt;<A 
  href="mailto:Bob.Deskin@cognos.com">Bob.Deskin@cognos.com</A>&gt; 
  wrote:</SPAN> 
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
    <DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>On an 
    ADD UPDATE, QTP attempts to retrieve during the initialization phase. If no 
    record is retrieved, it will attempt to add during the output phase. If a 
    record was retrieved, it will attempt to update. </FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Guy's 
    suggestion is one possible&nbsp; (and common) cause of an add failure. 
    </FONT></SPAN><SPAN><FONT face=Arial color=#0000ff size=2>And he's right, 
    sending the code will help us isolate the problem or at least suggest some 
    very specific possible causes. </FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>Bob</FONT></SPAN></DIV><BR>
    <BLOCKQUOTE style="MARGIN-RIGHT: 0px">
      <DIV lang=en-us dir=ltr align=left>
      <HR>
      <FONT face=Tahoma size=2><B>From:</B> powerh-l-bounces+bob.deskin=<A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:cognos.com@lists.sowder.com" 
      target=_blank>cognos.com@lists.sowder.com</A> [mailto: <A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:powerh-l-bounces+bob.deskin=cognos.com@lists.sowder.com" 
      target=_blank>powerh-l-bounces+bob.deskin=cognos.com@lists.sowder.com</A>] 
      <B>On Behalf Of </B>Guy Werry<BR><B>Sent:</B> October 29, 2007 3:34 
      pm<SPAN class=q><BR><B>To:</B> <A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:powerh-l@lists.sowder.com" 
      target=_blank>powerh-l@lists.sowder.com </A><BR></SPAN><B>Subject:</B> RE: 
      Yet Again, QTP Failure: OUTPUT --&gt; ADD 
UPDATE<BR></FONT><BR>&nbsp;</DIV>
      <DIV><SPAN class=e id=q_115ed47d71fd3293_3>
      <DIV></DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
      size=2><SPAN>Vamshi,</SPAN></FONT></DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
      size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>I 
      believe that I have had a similar problem when the input phase returns 
      MORE THAN ONE record complex.</SPAN></FONT></DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
      size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>It 
      would be very helpful if you could include a screen shot of the code and 
      error.&nbsp; That might make it easier to diagnose.</SPAN></FONT></DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
      size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
      size=2><SPAN>Thanks,</SPAN></FONT></DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>
      <P><FONT size=2>Guy L. Werry<BR>Senior Systems Analyst<BR>Hudson Bay 
      Mining &amp; Smelting Co., Limited. </FONT></P></SPAN></FONT></DIV><BR>
      <DIV lang=en-us dir=ltr align=left>
      <HR>
      <FONT face=Tahoma size=2><B>From:</B> powerh-l-bounces+guy.werry=<A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:hbms.ca@lists.sowder.com" 
      target=_blank>hbms.ca@lists.sowder.com</A> [mailto:<A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:powerh-l-bounces+guy.werry=hbms.ca@lists.sowder.com" 
      target=_blank> powerh-l-bounces+guy.werry=hbms.ca@lists.sowder.com</A>] 
      <B>On Behalf Of </B>vamsi krishna<BR><B>Sent:</B> Monday, October 29, 2007 
      2:12 PM<BR><B>To:</B> <A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:powerh-l@lists.sowder.com" 
      target=_blank>powerh-l@lists.sowder.com</A><BR><B>Subject:</B> Yet Again, 
      QTP Failure: OUTPUT --&gt; ADD UPDATE<BR></FONT><BR>&nbsp;</DIV>
      <DIV></DIV>Hello All,<BR><BR>I'd seen a case where the QTP program failed 
      .<BR>It was something like<BR><SPAN style="FONT-WEIGHT: bold">Output xyz 
      add update</SPAN><BR><BR>how a QTP can fail with error message "Failed to 
      add when a Unique Key/Index was specified" <BR>What I understand from 
      OUTPUT ---&gt;Add Update is QTP tries to add first, if the records exists, 
      it updates the record with new values, and if this is the case, how could 
      such a QTP Fail!<BR><BR><BR>Please let me know if you if it's something 
      else. <BR><BR>Thanks in advance :-D<BR><BR>Regards, <BR>Vamsi<BR 
      clear=all><BR>-- <BR>"Nothing is impossible as impossible itself says i m 
      possible" The information in this e-mail and any attachments is 
      confidential and may be subject to legal professional privilege. It is 
      intended solely for the attention and use of the named addressee(s). If 
      you are not the intended recipient, or person responsible for delivering 
      this information to the intended recipient, please notify the sender 
      immediately. Unless you are the intended recipient or his/her 
      representative you are not authorised to, and must not, read, copy, 
      distribute, use or retain this message or any part of it. 
    </SPAN></DIV></BLOCKQUOTE></DIV><BR>--<BR>= = = = = = = = = = = = = = = = = 
    = = = = = = = = = = =<BR>Mailing list: <A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="mailto:powerh-l@lists.sowder.com">powerh-l@lists.sowder.com 
    </A><BR>Subscribe: &amp;quot;subscribe&amp;quot; in message body to <A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="mailto:powerh-l-request@lists.sowder.com">powerh-l-request@lists.sowder.com</A><BR>Unsubscribe: 
    &amp;quot;unsubscribe &amp;lt;password&amp;gt;&amp;quot; in message body to 
    <A onclick="return top.js.OpenExtLink(window,event,this)" 
    href="mailto:powerh-l-request@lists.sowder.com">powerh-l-request@lists.sowder.com</A><BR><A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://lists.sowder.com/mailman/listinfo/powerh-l" 
    target=_blank>http://lists.sowder.com/mailman/listinfo/powerh-l</A><BR>This 
    list is closed, thus to post to the list you must be a subscriber.<BR>Add 
    'site:<A onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://lists.sowder.com/" target=_blank> lists.sowder.com</A> 
    powerh-l' to your search terms to search the list archive at 
  Google.<BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>"Nothing is 
  impossible as impossible itself says i m possible" </BLOCKQUOTE></BODY></HTML>