Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating Unique ID
Message
From
28/11/2001 11:56:54
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00586682
Message ID:
00587043
Views:
38
>>>
>>>Right. I've determined, that in time of APPEND BLANK the current alias is indeed the table, we're appending. So, here is the changed function (I also changed name of NextID to FunLibID to avoid possible errors):
>>
>>Append blank - yes
>>Under all scenarios - no
>>
>>Supply uniqueid in default().
>>Cetin
>
>What could be other scenarios? Yes, I have default value to be GetNextID('AllFunctions'). Do you think, it would not work for insert ? Or for manual invokation of this procedure? Yes, haven't thought of that. Ok, now I need something more sophisticated again... :)

No the problem is you have much more sophisticated thing than needed :)

It would work for append blank, insert, view insertion, command window, browse Ctrl+Y etc if simply is default value and not explicitly a value is provided. It's in DBC's stored procedure, right ? If so DBC knows itself and its ID table. Even if there is a GetNextID.prg around stored procedure takes presedence. So it would call its own DBC procedure which already knows its name and tables. You're in danger only if you have more than one table using the same default literally.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform