Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lookup Table
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00441504
Message ID:
00441937
Views:
15
Milt,
Interesting problem.... Ah the joys of someone ELSE's database design. (Worse is when you yourself designed it wrong - I'm rewriting something now for that reason).

However, you certainly can use SQL-Select. Now I'm assuming you have the customer ID and that there is only one record in Customer or only one record in Subscriber - can't have the same ID in both.

Method 1: Do a select on Customer, if it comes back blank do one on Subscriber:
SELECT * from customer where CustID = cSearchID into cursor curForm
if recc('curFrom') = 0
   ** No records
   use in curFOrm   && Close the cursor
   SELECT * from Subscriber where CustID = cSearchID into cursor curForm
endif

Method 2:
SELECT * from customer where custID = cSearchID  JOIN
   (Select * from Subscriber where CustID = cSearchID) into cursor curFORM
Method 1 is easier if you have different field names in the two tables.

Let me know if this makes sense or if you want to discuss it further.

Barbara



>I have the following situation. I have a form that contains an invoice table that has an customer id plus an invoice id. The problem is that the customer id may refer to either a subscriber table or a customer table. Unfortunately when this was originally designed the end user decide to keep them separate. At my suggestion I said let have a table for addresses which has the id for both subscriber and customer and then have another table which contains additional information for the subscriber. The only other information we keep about the customer is in the invoice table. We have subscriber who can order product plus outside customer who aren't subscriber can also order products. Anyhow it is too late to resolve that issue. Anyhow what I need to do is to create a lookup form that will pull the address information from both the subscriber and customer table plus information from the invoice table. I am not sure how large a record set I will be dealing with for the invoice table
>but I do know the subscriber table is about a million records. I don't believe I will be able to use a SQL statement at least not that I know because it would contain nulls. Am I better off create a lookup table which will store the information I need for lookup. Would that also be faster than using any view or sql.
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform