Solution: Using ALTEREDRECORD in QTP

Dennis Hassell dennis@dhassell.com
Sat, 2 Aug 2003 00:32:40 -0400


IIRC (it's been a few years), open a second copy of the file for output,
with an alias name. Then look up on A and update on A_ALIAS. You'll need
a unique key to link the lookup to the output.

Inside the program, make all the changes to A_ALIAS, and test for
ALTEREDREC of A_ALIAS for the condition below.

I'm curious, though - the UPDATE won't happen unless there is a
condition of ALTEREDRECORD anyway, and then the FINAL kicks in. I think
the condition is redundant.

I've found QTP to be tough to work with when depending on the ITEM
statements and IF conditions for anything much more than simple data
transformation. I usually use the selection criteria to handle all of
the if conditions, so everything selected (input phase) gets sorted
(sort phase) and output (output phase). Input and output phases work
differently with the conditions, so read up on them in the QTP manual.

Dennis Hassell
Dennis Hassell and Associates
(941) 746-4919
(941) 224-3981 - cell


-----Original Message-----
From: powerh-l-admin@cube.swau.edu [mailto:powerh-l-admin@cube.swau.edu]
On Behalf Of David Morrison - Corporate
Sent: Friday, August 01, 2003 2:27 PM
To: powerh-l@lists.swau.edu
Subject: Solution: Using ALTEREDRECORD in QTP

I tried using ALTEREDRECORD to condition the output of a temporary
subfile (containing the vendor key fields), right after the ITEM
statements.  This subfile can be used in a second request to go back and
update the vendor record.  This seemed to work properly, if inelegantly.

Thanks.

-----Original Message-----
From: David Morrison - Corporate 
Sent: Friday, August 01, 2003 11:11 AM
To: powerh-l@lists.swau.edu
Subject: Using ALTEREDRECORD in QTP


I'm running PH607F on an iSeries (AS/400).  I'm not sure if that matters
or not.

Here's my test program, carved out of a much larger one with lots of
ITEM statements:

------------
                                                        
access spo_vendor_master                                
                                                        
choose company_number "001", location_number "013", &   
       vendor_number "GRAY01"                           
                                                        
output spo_vendor_master UPDATE                         
  ITEM vendor_zip FINAL vendor_zip + 1                  
  ITEM vendor_maintained_date     FINAL SYSDATE      &  
       IF ALTEREDRECORD OF spo_vendor_master    
  
----------

When executed, the test program updates the ZIP code in the vendor
master, but doesn't update the maintained date.

1. Shouldn't it?  If not, when WOULD you use ALTEREDRECORD in QTP?
2. If it shouldn't, is there an easy alternative?  

Thanks.

David Morrison                

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to
powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.


_________________________________________________
Scanned on 01 Aug 2003 18:22:50
Scanning by http://erado.com

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to
powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.