Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select max() from a table with tablebuffer - HELP !!
Message
De
03/06/2002 08:17:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
03/06/2002 08:06:19
Joao Godinho
Fredesenvolv, Lda
Lisbon, Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00663992
Message ID:
00663996
Vues:
12
>Hi !!
>
>Hi have two users and i want to find the maxium of a table column but ....
>I´m using table buffer and the tableupdate is decided by the user !!
>
>please help !! what i'm doing wrong ??
>
>Thank you ALL
>
>SET MULTILOCKS ON
>create database demo
>open database demo
>CREATE TABLE "orders.dbf" NAME orders ( order_id N(5))
>
>select 1
>use orders shared
>lSuccess=CURSORSETPROP("Buffering", 5, "orders")
>
>append blank
>replace orders.order_id with 1 &&->user 1
>
>append blank
>replace orders.order_id with 2 &&->user 2
>
>browse
>
>select max(order_id) from orders into array max_order_id &&->by user 1
>
>if type("max_order_id[1]") = "N"
> wait window str(max_order_id[1],5)
>else
> wait window type("max_order_id[1]")
>endif

Joao,
SQL would never read from uncommitted data. With multiusers and buffering you have no chance to read max order_id. Your best bet is to use another table unbuffered to dispatch order_id. See solution.app nextid using.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform