Yet Again, QTP Failure: OUTPUT --> ADD UPDATE

Peter Bateman peterbateman808 at hotmail.com
Thu Nov 1 22:46:02 CDT 2007


Vamsi:
      Some hints:
 
      1) Qualify the access for your ADD UPDATE. The one
          generated by QTP may not be one you want.
 
      2) The access for an "ADD UPDATE", "UPDATE" and
          "DELETE" occurring at a control break happens
          at the start of the control break, therefore make 
        sure that within the control break no new records
        have been added that have the same key values
          
      3) Create an ITEM statement for every item in
          the output record. Use INITIAL for only those
          items that you want to set when creating a 
          new record Qualify the items in the ITEM statement
      
      5) You are using parallel linkage in your ACCESS statement.
          When there is an unequal match the side of the 
          linkage which has less records will be fill with
          dummy records  made up of default values unless
          the parallel linkage was to an unique key. In that
          case the same uniquely keyed record is repeated in the parallel
          linkage for each of the non-uniquely keyed records.
       6) If the output is to an IMAGE master dataset, please read up
           on how to handle migrating secondaries in QTP.
 
        7) QTP tracer may be helpful in this regard if your version of QTP
            supports it.
 
        8) If you are writing to a C-ISAM file the bcheck utility can verify the
             integrity of indexes.
 
       Regards,
       Peter Bateman 


Subject: RE: Yet Again, QTP Failure: OUTPUT --> ADD UPDATEDate: Tue, 30 Oct 2007 09:06:33 -0400From: Bob.Deskin at cognos.comTo: vamsi.coe at gmail.comCC: powerh-l at lists.sowder.com

Not knowing the exact data content and record structures make this a series of guesses.
 
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.
 
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?
 
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. 
 
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.
 
Bob



From: vamsi krishna [mailto:vamsi.coe at gmail.com] Sent: October 29, 2007 6:11 pmTo: Deskin, BobCc: Guy Werry; powerh-l at lists.sowder.comSubject: Re: Yet Again, QTP Failure: OUTPUT --> ADD UPDATE

Hello Bob,
 
Here's the failure extract:

Attempt to add a duplicate value when UNIQUE KEY/INDEX was specified.   [8182]   File:  SPOIINP1-UPD     Linkitem:  SPOIINP1-KEY                         93169029301EURL
Action Taken: Run terminated.------------------------------------------------------------------------------- 
Records read:  IPWSPRI2_S                          11,613  SPOIINP1                             5,422  PPMINSCP                             5,596 
Transactions processed:                8,182  SPOIINP1                             5,422  PPMINSCP                             5,596
Transactions processed:                8,182
Records processed:                     Added    Updated  Unchanged    Deleted  SPOIINP1-UPD                           124      4,085          0          0  PPMINSCP-UPD                             0         90      4,119          0   IPWSPRI3_S                               2          0          0          0
Finished.And Here's the code part:
 

ACCESS *$IPWSPRI2_S LINK &RJ(GM-PART) + &TEMP-NSC + &PRIC-LIST + &CURR-CODE +&OUTLET_1 TO &SPOIINP1-KEY OF SPOIINP1 OPTIONAL AND & RJ(GM-PART) , &TEMP-NSC , &PRIC-LIST , &CURR-CODE TO &GM-PART , &NSC-CODE , &PRIC-LIST-NUM , &PRIC-CURR OF PPMINSCP OPTIONALTEMPORARY TEMP-UNIT INTEGER * 9 SIGNED SIZE 4 BYTES TEMPORARY TEMP-COST INTEGER * 16 SIGNED SIZE 8 BYTESTEMPORARY TEMP-VALU INTEGER * 16 SIGNED SIZE 8 BYTESSORTED ON GM-PART OF IPWSPRI2_S, &TEMP-NSC OF IPWSPRI2_S, &PRIC-LIST OF IPWSPRI2_S, & CURR-CODE OF IPWSPRI2_S, &OUTLET_1 OF IPWSPRI2_S
ITEM TEMP-UNIT SUBTOTAL PART-QTY RESET AT OUTLET_1ITEM TEMP-COST SUBTOTAL PLAN-PRIC RESET AT OUTLET_1 ;L0001ITEM TEMP-VALU SUBTOTAL NET-AMOU-LOC RESET AT OUTLET_1 ;L0001 
OUTPUT SPOIINP1 ADD UPDATE ALIAS SPOIINP1-UPD AT OUTLET_1 &IF RECORD PPMINSCP EXISTITEM ................
 
In the input subfile, there was only one record corresponding to Unique Key value.
But the data, which was attempted to add, it was exactly the same record which existed in the file.
So, Is there a possibility that it failed "while adding (unique key) +updating record with same values" ??
It's just a wild guess :-)
Let me know if you need more details
Regards,
Vamsi
On 10/30/07, Deskin, Bob <Bob.Deskin at cognos.com> wrote: 


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. 
 
Guy's suggestion is one possible  (and common) cause of an add failure. And he's right, sending the code will help us isolate the problem or at least suggest some very specific possible causes. 
 
Bob



From: powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com [mailto: powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com] On Behalf Of Guy WerrySent: October 29, 2007 3:34 pmTo: powerh-l at lists.sowder.com Subject: RE: Yet Again, QTP Failure: OUTPUT --> ADD UPDATE 


Vamshi,
 
I believe that I have had a similar problem when the input phase returns MORE THAN ONE record complex.
 
It would be very helpful if you could include a screen shot of the code and error.  That might make it easier to diagnose.
 
Thanks,

Guy L. WerrySenior Systems AnalystHudson Bay Mining & Smelting Co., Limited. 


From: powerh-l-bounces+guy.werry=hbms.ca at lists.sowder.com [mailto: powerh-l-bounces+guy.werry=hbms.ca at lists.sowder.com] On Behalf Of vamsi krishnaSent: Monday, October 29, 2007 2:12 PMTo: powerh-l at lists.sowder.comSubject: Yet Again, QTP Failure: OUTPUT --> ADD UPDATE 
Hello All,I'd seen a case where the QTP program failed .It was something likeOutput xyz add updatehow a QTP can fail with error message "Failed to add when a Unique Key/Index was specified" 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!Please let me know if you if it's something else. Thanks in advance :-DRegards, Vamsi-- "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. --= = = = = = = = = = = = = = = = = = = = = = = = = = = =Mailing list: powerh-l at lists.sowder.com Subscribe: &quot;subscribe&quot; in message body to powerh-l-request at lists.sowder.comUnsubscribe: &quot;unsubscribe &lt;password&gt;&quot; in message body to powerh-l-request at lists.sowder.comhttp://lists.sowder.com/mailman/listinfo/powerh-lThis list is closed, thus to post to the list you must be a subscriber.Add 'site: lists.sowder.com powerh-l' to your search terms to search the list archive at Google.-- "Nothing is impossible as impossible itself says i m possible" 
_________________________________________________________________
Are you ready for Windows Live Messenger Beta 8.5 ? Get the latest for free today!
http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20071102/57f5f37a/attachment.htm


More information about the powerh-l mailing list