>> Yes. This is customer requirement and I cannot change it.
> OR... can you go back to your customer and tell them they wont like this.
> Really really they should let you do it correctly. I find people dont
> change because they dont have to, not because there is an actual reason.
> Many times, given a description of how hard and how messy something will
> be to code, I have convinced people that a simple business change and
> simple code is really the best approach. But I have hit walls. Things I
> could not change, but I did try.
My Visual FoxPro application works OK in this case.
I used FLOCK() to lock invoice header table (FLOCK() waits indefinitely
until lock is obtained and reads fresh data from disk),
used
SELECT MAX( CAST( SUBSTRING(invoiceno,8) AS INT ) )+1
FROM invoices
WHERE date= m.invoice_date
to get next free number, inserted invoice and unlocked the table.
Customer expects Postgres to be more powerful than FoxPro . He don't
understand why this stops working after upgrade.
Andrus.