|
Hi, I have two files. The primary has an alpha field 21 characters long. Positions 1 - 15 are the item number & 16 - 21 are a customer number. I have to bring in info from this file and the item master, and sort on an item master field. I tried the following SQL, but I get no hits. If I take out the item master(IIM) stuff and print the fields item & cust, they look OK. Can I do this? What am I doing wrong? 0042.00 C/EXEC SQL DECLARE A CURSOR FOR 0043.00 C+ SELECT PRKEY,IDESC, 0044.00 C+ SUBSTR(PRKEY,1,15) as ITEM, 0045.00 C+ SUBSTR(PRKEY,16,6) as cust,PMETH 0046.00 C+ FROM ESP, IIM 0047.00 C+ WHERE PMETH = 'A' 0048.00 C+ AND :CUST IN (' ', '770440') 0049.00 C+ AND :ITEM = IPROD 0050.00 C+ ORDER BY prkey 0051.00 C/END-EXEC 0052.00 C/EXEC SQL 0053.00 C+ OPEN A 0054.00 C/END-EXEC And then in a DO loop 0074.00 C/EXEC SQL 0075.00 C+ FETCH NEXT FROM A INTO :PRKEY, :idesc, :item, :cust 0076.00 C/END-EXEC <===================================================> Terri Harteau Felker Brothers Corp. **************** "There's no point in being grown up if you can't be childish sometimes." - Dr. Who ****************
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.