Re: [DUG]: A simple SQL question...

2000-02-13 Thread Kerry Sainsbury
Hi Dennis, > > The way make sure that you have no deadlock problems is to > > ensure that it's > > never called from inside a transaction. > > And if you don't have a transaction ... you end up with missing numbers, > partial orders, and worse still, more deadlocks. This is because Yes, you can

RE: [DUG]: A simple SQL question...

2000-02-13 Thread Dennis Chuah
> -Original Message- > > In C/S, you do not normally request an exclusive lock. The > first query > > increments the field, and as the transaction is still > pending, the server > > will lock the record. If the record is already locked > (because another > > process is in the middle o

Re: [DUG]: A simple SQL question...

2000-02-10 Thread Kerry Sainsbury
Comments below... > Welcome to the world of C/S programming. You will need to use a > transaction: > > TDatabase.StartTransaction; > try > TQuery.SQL.Text := 'update singleelementtable set somefield=somefield+1'; > TQuery.ExecSQL; > TQuery.SQL.Text := 'select somefield from singleelementta

RE: [DUG]: A simple SQL question...

2000-02-10 Thread Dennis Chuah
age- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of Terry Johnson > Sent: Friday, 11 February 2000 14:08 > To: Multiple recipients of list delphi > Subject: [DUG]: A simple SQL question... > > > Suppose you are wanting to insert an order into an

Re: [DUG]: A simple SQL question...

2000-02-10 Thread Aaron Scott-Boddendijk
>When working with tables, you could use a single element database that was >accessed exclusively, so that an open-read-increment-write-close procedure >would handle it nicely. >In migrating to an ADO/ODBC SQL interface, how would you achieve the same >thing? The TQuery does not support the exclu

Re: [DUG]: A simple SQL question...

2000-02-10 Thread Neven MacEwan
Terry What Database? Regards Neven - Original Message - From: Terry Johnson <[EMAIL PROTECTED]> To: Multiple recipients of list delphi <[EMAIL PROTECTED]> Sent: Friday, 11 February 2000 14:08 Subject: [DUG]: A simple SQL question... Suppose you are wanting to insert a

[DUG]: A simple SQL question...

2000-02-10 Thread Terry Johnson
Suppose you are wanting to insert an order into an order database. The first thing you need is a sequential order number. When working with tables, you could use a single element database that was accessed exclusively, so that an open-read-increment-write-close procedure would handle it nicely.