Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a part number
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00018858
Message ID:
00018875
Vues:
36
>I have an inventory type table and when I enter a new part, I want VFP
>to automatically assign a unique part number to it. I know it can be done,
>is there an easy way. thanks for the help.

The easy way is to put a function in your Stored Procedures, and make the Default Value of the part number a call to that function.

select the table
save the record number
calculate max(part_no) to lnMaxPartNo
Go oldRecNo
replace part_no with lnMaxPartNo

That's the fast way. The better way is to save the next part number in another table, and lock that record, get the value, increment it, and unlock the record.

That clear enough, or did I garble it too much?
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform