I am using a shipping program that scans our Order Number and populates the shipping fields from a database file using an ODBC connection. Once the fields are populated, the user then prints out a shipping label and we writeback information to another database file using a different ODBC connection. We are trying to prevent the user from accidentally scanning in the same Order Number twice and we need to do this independent of the shipping software. Here is the database structure:
RETRIEVAL DB FIELDS (ODBC1): OrderNumber, Name, Address1, Address2, City, State, Zip
WRITEBACK DB FIELDS (ODBC2): OrderNumber, TrackingNumber, Weight, ShippingPrice
We would like to avoid using the same file for both Retrieval and Writeback as this would trigger a host of other changes to the backend. Is there a way in SQL to scan the Order Number from the Retrieval DB and have it check to see if that Order Number has been written to the Writeback DB before it populates the shipping fields?