<!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> </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> </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> </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> </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> </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 --> ADD UPDATE<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Hello Bob,</DIV>
<DIV> </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.
[8182]<BR> File: SPOIINP1-UPD<BR>
Linkitem:
SPOIINP1-KEY</STRONG>
<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>
IPWSPRI2_S
11,613<BR>
SPOIINP1
5,422<BR>
PPMINSCP
5,596</FONT></STRONG> </P>
<P><STRONG><FONT face="courier new,monospace" size=1>Transactions
processed:
8,182<BR>
SPOIINP1
5,422<BR>
PPMINSCP
5,596</FONT></STRONG></P>
<P><STRONG><FONT face="courier new,monospace" size=1>Transactions
processed:
8,182</FONT></STRONG></P>
<P><STRONG><FONT face="courier new,monospace" size=1>Records
processed:
Added Updated Unchanged
Deleted<BR>
SPOIINP1-UPD
124
4,085
0 0<BR>
PPMINSCP-UPD
0
90
4,119 0 <BR>
IPWSPRI3_S
2
0
0 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> </DIV>
<DIV><FONT size=2><FONT face="">
<P><BR><BR><FONT face="courier new,monospace" size=1>ACCESS *$IPWSPRI2_S LINK
&<BR>RJ(GM-PART) + &<BR>TEMP-NSC + &<BR>PRIC-LIST +
&<BR>CURR-CODE +&<BR>OUTLET_1 TO &<BR>SPOIINP1-KEY OF SPOIINP1
OPTIONAL AND & <BR>RJ(GM-PART) , &<BR>TEMP-NSC , &<BR>PRIC-LIST ,
&<BR>CURR-CODE TO &<BR>GM-PART , &<BR>NSC-CODE ,
&<BR>PRIC-LIST-NUM , &<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, &<BR><BR>TEMP-NSC OF IPWSPRI2_S, &<BR><BR>PRIC-LIST OF
IPWSPRI2_S, & <BR><BR>CURR-CODE OF IPWSPRI2_S, &<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 &<BR>IF RECORD PPMINSCP EXIST<BR>ITEM
................</FONT></P>
<P> </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> <<A
href="mailto:Bob.Deskin@cognos.com">Bob.Deskin@cognos.com</A>>
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> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Guy's
suggestion is one possible (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> </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 --> ADD
UPDATE<BR></FONT><BR> </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> </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> </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. 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> </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 & 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 --> ADD UPDATE<BR></FONT><BR> </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 --->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: &quot;subscribe&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:
&quot;unsubscribe &lt;password&gt;&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>