With multi selects, you need to bail out if the first select returns zero records. In universe, check @SYSTEM.RETURN.CODE - if LE to zero you need to account for this otherwise secondary selects will run. The SYSTEM() function also has info related to active select info - I think SYSTEM(11) - check manual to be sure.
-----Original Message----- From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> To: [email protected] <[email protected]> Sent: Sat Jul 09 17:01:57 2005 Subject: [U2] Strange phenomena using EXECUTE QSELECT and DATA statements in subroutine I'm having a problem I just can't figure out a solution to. Got a 'home made' index file with record key being a purchase order 'group reference#' and the 2nd attribute contains an mv array of all purchase order numbers Am working on writing a 'lookup' subroutine that will utilize this index file. Using commands like: QUERY = \SELECT PO.GROUP = 'Group Reference'\ DATA \QSELECT PO.GROUP (2)\ DATA \SSELECT POF BY GROUP BY-DSND PO.DATE\ EXECUTE QUERY Well, this works absolutely fine as long as the user enters in a group reference# that exists. BUT, from the first subroutine call where a user enters a group reference# that does not exist the lookup subroutine fails from that point on to return any results even if the user subsequently enters an existing group reference#. I hope I explained this properly. Bottom line is - the subroutine fails forever to return any results after the first instance where a user keys in a ref# that does not exist even when they retry with a valid ref#. I just don't get it. I would expect that if a user keys in a ref# that doesn't exist the query in the subroutine merely returns no records keys - of course - but if it is called again with a ref# that does exist I would fully expect it to return results as it does 'the first time' it is called and an existing ref# is entered. joe Joe Walter "Live dangerously - Communicate!" 8..7 4(()) -:&:- -:&:- 8.74 .74(()) ((88.74 ..74 -:&:- ((88.74 * ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
