Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple ID Generator Not Fast
Message
De
30/11/2001 08:22:11
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00587741
Message ID:
00587918
Vues:
25
Welcome back Vlad,

Yes, I have been using this idea - which you gave me - for awhile now. It works great and fast. A little bit of maintenance once-in-awhile, but nothing too heavy.

Renoir

Steve: FYI

>Hi!
>
>Because despite the "TOP 1" ODER BY in the query cause getting the entire table for sorting. THis is slow approach, indeed. There are other approaches. One of them is to use the table that store last ID for each table (described in many places, you can read about it in the FAQ article at the www.tek-tips.com site, VFP forum).
>
>>I made a free table with two columns iValue and iDel (both integers). There are 500,000 rows in the table. With the following ASP I get a value the way I want it. However, it is much slower than having 50,000 rows in the table. Why? I have simple indexes on both columns.
>>
>>
>>Response.Buffer = True
>>Response.ContentType = "text/xml"
>>Set oConn = Server.CreateObject("ADODB.Connection")
>>With oConn
>>    .ConnectionString = "Provider=VFPOLEDB.1;Data Source=E:\localweb;Deleted=Off;Password=;Collating Sequence=MACHINE"
>>    .CursorLocation = 2	'	adUseServer
>>    .Mode = 16			'	adModeShareDenyNone
>>    .Open
>>End With
>>Application.Lock
>>arResult = oConn.Execute("Select iValue from UniqInt02 Where iDel=0 Order by iValue Top 1").GetRows
>>oConn.Execute("Update UniqInt01 Set iDel=1 Where iValue=" & arResult(0,0) )
>>Application.Unlock
>>Response.Write "<?xml version="&Chr(34)&"1.0"&Chr(34)&"?><ROOT><response><ivalue> " & arResult(0,0) & "</ivalue></response></ROOT>" ' There is an XML string there you just can't see it on the UT
>>Set oConn = Nothing
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform