Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating unique Order No
Message
From
17/06/2009 13:32:27
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01406619
Message ID:
01406642
Views:
70
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I have an application that looks like it was converted from 2.6 at some point and then moved to VPM 6.0
>
>The tables are in the database, but not really properly normalized. The Orders table has OrdNo field (Numeric 7), which I believe is supposed to be a PK in this table. I'm not sure how exactly it was populated originally.
>
>The question is - how can I generate the unique Order No ? I don't know if it would be a good idea to introduce counter table to this existing application?
>
>Any ideas here? I've searched the whole project and I don't see a single INSERT command involving OrdNo field - it is probably done with APPEND BLANK and REPLACE.
>
>Thanks in advance.

If the number looks sequential then you may calculate max()+1 at saving point and use it for the next record. Insert command would be checked for candidate/primary key duplicate error. It should be sufficient if number of users is small.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform