Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select max(fkey) from table into array lavalue
Message
From
31/01/2006 06:01:16
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
31/01/2006 03:24:50
Ken Knorr
Logos Management Software
Ventura, California, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01091785
Message ID:
01091810
Views:
16
This looks like you're trying to generate the next primary key. MAX(primary_key) is one of the slowest ways to do it.

http://fox.wikis.com/wc.dll?Wiki~MkKey

>In vfp 8 i would get the max integer key value in a table with:
>
>local lavalue[1]
>lavalue = .f.
>select max(fkey) from table into array lavalue
>
>lavalue[1] would return .f.
>
>in Vfp 9 sp1 this returns .NULL.
>
>I can change the select statement to
>select max(fkey) from table group by fkey into array lavalue
>
>and lavalue[1] will return .f.
>
>
>Code to test this
>
>create cursor ken (fkey I)
>local lavalue[1]
>
>lavalue = .f.
>select max(fkey) from ken into array lavalue
>? lavalue[1]
>
>I don't remember having this problem in Vfp 9
>has any one else had this problem?
>
>Ken
Previous
Reply
Map
View

Click here to load this message in the networking platform