Re: Generating SQL

From: Otavio C. Decio (REMOVEodecio_at_earthlink.REMOVE.net)
Date: 11/18/04


Date: Thu, 18 Nov 2004 06:56:28 -0500


"Topmind" <topmind@technologist.com> wrote in message
news:4e705869.0411172259.3abc59f4@posting.google.com...
> > > Well, a real table is easier to edit and maintain by far
> > > in my opinion than one in linear text code. But, this is
> > > assuming you already have the right tools. If not, then I
> > > suppose classes are a consolation prize, but DD's can be
> > > made many other code-centric ways besides classes.
> > >
> >
> > Yeah, change the table and leave the code as it is. I don't think it
will
> > work.
> >
>
> Example?

Simple. Suppose you add a new column to a table. If you have concatenated
SQL, you might have to account for the new column on every statement that
talks to that table. This includes insert, delete, select and update -
probably many of them. In my model, you add a new column to the database,
add a new property in the value object class and you're done.

>
> >
> >
> > I beg to differ. Concatenated string are a PITA.
>
> I have not found them to be a problem.

Good for you.

<ship>
>
> > simple CRUD stuff.
>
> Well, most CRUD I encounter is not that simple. Perhaps it could be
> simple if the tables were normalized and people factored stuff, but
> the reality is often messy grown-viney-over-time cruft,
> resulting in somewhat complicated
> SQL. For example, sometimes there are 3 fields that are packed
> into one and visa versa. Or, the results being saved to multiple
> tables.

There is no substitute for good database design.

>
> >
> > > > Just because programmers are cheap these days doesn't mean that
hiring a
> > > > dozen of sql-concatenating of them will be any guarantee of success.
> > >
> > > Nor does reinventing the whole of SQL via verbose API's.
> >
> > I agree. I'm not doing that.
>
> Okay, we both agree to wrap the simple stuff. If stuff grows
> non-simple, don't force it.

If stuff grows non simple, there is a chance you're doing something wrong.

>
> >
> > >
> > > > > -T-

Otavio



Relevant Pages

  • Re: TypeError
    ... > I note that in the code shown there are examples of building an SQL ... and that's presumably why the OP is constructing whole ... cursor.executefrom %sCustomerData;' % store) ... The bad database design has been ...
    (comp.lang.python)
  • Re: transition from programmer to developer
    ... copies of Chris Date's "Principles of Database Design" and "The SQL ... Standard" on my shelf. ... SQL standard. ... Newcomers to database design may not have heard of Chris Date. ...
    (comp.lang.java.programmer)
  • Re: how to sum a text field with commas
    ... "BY DEFINITION a column has scalar values, this is not a valid value in SQL" ... Holding "1,2,3" in a column has nothing to do with DDL, DML, DCL, and transaction control. ... IT has everything to do with database design 1nf, ... I find that most one-shot jobs have the data I want on a ...
    (microsoft.public.sqlserver.programming)
  • Re: Pass Field Name Using Variable to SQL string
    ... First of all, you have a HORRIBLE database design, which violates ... important database design principles such as the "repeating group" ... I want to use a recordset with SQL to identify the current field and edit ... This syntax works perfectly in the SQL to identify the current field in the ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Generating SQL
    ... >> That only allows automatic column info generation. ... it was never my intent to entirely wrap SQL. ... most CRUD I encounter is not that simple. ...
    (comp.object)