× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



A number of things:
1 - You do not need the external file name if you are accessing it via sql
2 - I'd use an external data structure for field definitions.  Like
D myds       eds                                     extname(item_pf)
3 - How many items with the same item number do you expect to find in the 
item file?  Doesn't the file have a primary key constraint?  If you are 
only expecting one, then get rid of the cursor and use a direct select 
into.  If you insist on using the cursor, then you will need to close it 
and open it within your loop.  Notice that the open on the cursor has a 
WHERE clause?  Notice that you are selecting on an item number before you 
are prompted for it?  That will work on the parameter that you passed into 
the program, but not on any values prompted.
4 - skip %found, use sqlstt for the select into, or the fetch.

If you need to test for multiple item numbers you may want to try
select count(*), itemnbr, max(itemdescr) from item_pf
group by itemnbr
having count(*)>1

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.