Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String vs. Integer PK values.
Message
 
À
27/07/2009 11:35:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01414751
Message ID:
01414985
Vues:
55
Hi Matt,

> please confirm that it is valid/reasonable to let a user enter a string into a lookup box that matches a string-based PO# or JobNo reference, like "MS3424C" or "UR-23423A" and then I have to do an intermediate lookup to search for the corresponding Integer PK.

A business object absolutely can have methods that take a non-PK identifier. You don't even have to translate this to an integer PK for the query, as long as your links are done on the PK. Simplified:
PROCEDURE GetCustomerByCustomerNo(tcCustNo)
  SELECT ... ;
    FROM Customers ;
   JOIN Addresses ON Customer.pk == Addresses.CustFK ;
   WHERE CustNo = tcCustNo
ENDPROC
Key point is that these values should never make it from the WHERE clause into the JOIN clause.
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform