Re: NextNumbers Tables

From: Alan Gutierrez <>
Date: Tue, 11 Feb 2003 15:15:48 GMT
Message-ID: <Es82a.25941$>

stu wrote:

> Thanks for that Alan.

> Unfortunately I only have DB2 5.1 (AS/400).

Try using the two part: insert 0, update select max + 1. It works on

     PostgreSQL, make sure it works on DB2.

> To be honest I could not give a monkeys if all my tables are fully
> normalised :-). If they do their job and it makes developing easier (=
> faster = less cost) the customer is happy and that is my job. So from this
> respect would it be better to use surrogate keys as primary keys?

Don't be so lazy. This is a design decision. Either you develop an

     understanding of normalization, and make educated decisions about
     when to denormalize, or hire someone to design your database for you.

> No offence intended. It has just been drummed into me that it is better to
> get something working sooner rather than working on all the theory, and I
> have seen this in practice: ppl who sit + wonder about all the theory tend
> to take far longer to deliver projects if at all. I like looking at this NG
> to see if I can take anything to help me be a better designer but I like to
> KISS (Keep It Simple Stupid)!

You are not listening Stu. Your attitude needs some adjusting. You don't

     seem to be too comfortable with critical thinking. I say this
     because for two reasons. First, you are hostile towards theory and
     design. Second, when presented with new information you continue to
     ask the same question.

I don't know where you studied, but in the real world, when a software
     system is given to people who don't understand the langauge,
     platform, or basic computer science principles, that project fails.
     Planing and goal-setting are basic principles of success, whether
     you are building software or a sandwich.  Just because some people
     are too insecure to implement, it does not follow that mindful
     software development is an effete princple from the ivory tower.

To experienced database developers, to question the whether a relational
     database should be normalized is like questioning whether a boat
     should be water-tight. If a relational database is not normalized,
     you do not have a relational database. Use a spreadsheet.

As far as your admonisment to be stupid and simple I will now offer the
     obligitory Einstien quote "Everything should be as simple as
     possible, but no simpler." The point being that the complexity of
     the problem will express itself in one form or another. If your
     database schema is simplistic, your queries are going to be
     extreamely complex.

You many have encountered some of the methodologies that were designed
     to keep the hourly-rate consultants in new BMWs. If this is the
     case, your reaction is understandable. No one here is advocating Big
     Upfront Design. These principles are second nature once understood.
     They produce better software faster.

Please don't top post.

Alan Gutierrez -
Received on Tue Feb 11 2003 - 16:15:48 CET

Original text of this message