Re: Generating SQL

From: Topmind (topmind_at_technologist.com)
Date: 11/15/04


Date: 14 Nov 2004 18:49:01 -0800


"Otavio C. Decio" <REMOVEodecio@earthlink.REMOVE.net> wrote in message news:<vcCdndLJWpilFQjcRVn-3A@giganews.com>...
> "Topmind" <topmind@technologist.com> wrote in message
> news:4e705869.0411121919.7b8bc7e9@posting.google.com...
> >
> > Example? Java reflection is uuuuuugly. If you are an OO fan,
> > at least use something like Python.
>
> In my case I used C#, and reflection is part of the underlying common
> language runtime. It is very powerful, and much more mature than Java. Also,
> I had virtually no impact on performance. I can quickly scan the structure
> of a value object class and determine everything necessary to produce
> objects from the database - column names, types, max size, etc.

Scanning a bunch of column descripter classes for column
info sounds like a kind of data dictionary.

>
> > Until they overhaul/rid SQL with a better relational language,
> > I have not seen anything better than some amount of
> > concatenation. Some of SQL is easy to wrap and some is
> > not. I wrap the easy (repetative) parts, but usually
> > directly concatenate the rest. I believe it to be a
> > good compromise. Past attempts to wrap the entire thing
> > have failed. I could not predict ahead of time all
> > the variations in SQL I would encounter dispite
> > trying. Thus, I gave up the 100% route and went with
> > an 80% route. Beyond the 80%, the returns diminish such
> > that it does not pay anymore to try to wrap/abstract.
>
> Concatenate? No, thanks.Only if I have no way to represent the query in my
> wrapper.
>
> >
> > Wrap the low-hanging fruit only instead of pretending
> > you can wrap ALL of SQL with a simple interface.
>
> So far I found that there is plenty of low hanging fruit to be wrapped.

Well, anything is wrappable, but that does not necessarily mean
that it should be wrapped. You may end up inventing a custom
language that is uglier and/or less documented than SQL.
I'll take a standardized devil over a custom-rolled devil
in most cases. If you get hit by a bus and your replacement
cannot find the documentation for your custom query API,
they may be in for a lot of
work. But if you get hit by a bus, there are still plenty
of SQL books and resources available.

Any business app programmer who does not know SQL should
be fired anyhow. Programmers are a dime-a-dozen these days,
and if you cannot find one who knows SQL (in addition to
app language), you must be locked in car.

>
>
> Otavio

-T-



Relevant Pages

  • Re: SQL
    ... SQL lacks a lot of stuff. ... I see nothing that keeps an RDBMs engine from using such techniques to ... A custom engine does ...
    (comp.object)
  • Re: SQL
    ... SQL lacks a lot of stuff. ... Same with relational languages. ... I see nothing that keeps an RDBMs engine from using such techniques to ... A custom made/tuned relational engine is certainly as possible ...
    (comp.object)
  • Re: Setup of SQLExpess Options
    ... application, you've included the SQL Express as pre-requisites, currently ... **Write a C program that uses COM to interoperate with DMO9, WMI, or SMO ... your custom .net code in setup project ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.vsnet.setup)
  • RE: custom xp_cmdshell on SQL Server
    ... custom xp_cmdshell on SQL Server ... password and escalate privileges. ... Cenzic Hailstorm finds vulnerabilities fast. ...
    (Pen-Test)
  • Re: [PHP] 2 Questions.
    ... My question is in the db wrapper, ... SQL then you'll have to parse the given SQL and rewrite it ... ... use generators or sequences or 'auto increment ids' or whatever your DB ... my soul that the guys that built it know the difference between an order ...
    (php.general)