How to do it correct

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

How to do it correct

Post by Zero-G. » Thu 03 Jan 2008 14:48

Hey

I do use your CRLab Solution myDIRECT 4.25 and mySQL Server 5.0.45-community-nt

So I do have 4 tables with different offers.
My boss wants, that the Invoice Number each year begins from 0. - So I think, that an extra invoice tabel with an autoincrement field will not be the right.
I have played around and have found out, that a Union of all 4 offer tables will bring me the max value of the invoice, which is saved in the offers table.
But is this SQL-technical correct!? - To read out a max value & add it with +1 and write it back as new invoice number!? - What is with the situation, when two people try to get the same number at the same time!? - Do I have to lock!?
Should I make a SP!?

Hope you understand what I try to do and maybe you can give me a good tipp, that will help me.

THX

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Fri 04 Jan 2008 10:13

Unfortunately, we cannot provide a general advice on this topic because this is beyond the scope of our support program.

Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Post by Zero-G. » Sat 05 Jan 2008 08:27

Hey

It's OK. - But I just wanted a answer, which could advise a Syntax correct way.

THX

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Wed 09 Jan 2008 11:00

Unfortunately we are not able to investigate your architecture deeply, but you can check if "LOCK TABLES" command is appropriate in your case. For more information please refer to MySQL manual.

Post Reply