Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: Table Lock in MySql
Thread ID: 373413 Message ID: 373571 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Saturday, March 23, 2013 1:14:54 PM         
   


> >
> > What code do you use to generate the invoice.
> >
> > Regards
> > Tushar
> > http://weblogs.foxite.com/tushar/
>
>
>
> = sqlexec(mConn,"Select Max(InvNo)as InvNo From Inv")
>
> Rgds:
> Ahsan Rana

Instead of that create a sequence table

CREATE TABLE invoicesequence ( id int NOT NULL auto_increment, dummy char(1))

Then insert into this
insert into invoicesequence (dummy) values ('')

and get the last insert id for your next invoice number. You can then delete the inserted row. No need to lock a table. Table locking will slow down the database if lots of users are using at the same time.

Regards
Tushar
http://weblogs.foxite.com/tushar/

ENTIRE THREAD

Table Lock in MySql Posted by Ahsan Rana @ 3/22/2013 3:32:58 AM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/22/2013 5:36:17 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/22/2013 11:36:41 AM
RE: Table Lock in MySql Posted by llyrad atsituab @ 3/23/2013 2:50:17 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 10:36:07 AM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/23/2013 10:47:07 AM
RE: Table Lock in MySql Posted by llyrad atsituab @ 3/23/2013 2:43:08 AM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/23/2013 5:05:02 AM
RE: Table Lock in MySql Posted by llyrad atsituab @ 3/22/2013 6:17:50 AM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 10:56:27 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 11:23:28 AM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 11:54:05 AM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 12:39:57 PM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 1:14:54 PM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 4:44:38 PM
RE: Table Lock in MySql Posted by tushar @ 3/23/2013 5:19:25 PM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 6:08:36 PM
RE: Table Lock in MySql Posted by Om Rajan @ 3/23/2013 9:31:19 PM
RE: Table Lock in MySql Posted by Tom Saddul @ 3/23/2013 12:12:06 PM
RE: Table Lock in MySql Posted by Ahsan Rana @ 3/23/2013 12:41:11 PM