All of them!
My personal opinion is no matter what you decide, for each person that
loves it, someone will not. It's a very hard problem to solve since SQL
doesn't map neatly into OO paradigm. I've used several apis for doing SQL
and, to me; I always feel the api gets in way of what I want
to say in SQL.
I typically write sql for a specific database that will not change
because too much time has been invested in it. So as a consequence I am
generating sql that will work only for a specific engine anyway and
I end up doing things like
SQL sql = new SQL();
sql.appendSelect(x,y,someFunction(z)");
sql.appendFrom("a,b,c ");
sql.appendWhere("blah (complex sub select) .. blah");
database.execute(sql);
The consequence is that even if I had a good SQL api, I couldn't use it
anyway.
I do like the convenence of having an SQL utility that works well with
the turbine peer model. Doing things like
SQL s = new SQLSelect(peer) are wonderful. But when I need to do
some crazy join, I find that I need to hard code the sql anyway.
just rambling,
mike
On Mon, May 28, 2001 at 11:16:06AM -0600, Eric Dobbs wrote:
> Taking a moment to question design goals for the new query model.
> As long as we're talking about redesigning from the ground up...
> Which of the following example sql statements would you like to
> be able to construct with the new query model?
>
> -Eric
>
> 1. simple selects
> select * from some_table
> where some_id = n;
>
> 2. multi-table joins
> select table1.name,table2.type_name
> from table1,
> table2,
> table3
> where table1.description like '%foo%'
> and table1.one_id=table3.one_id
> and table2.two_id=table3.two_id
>
> 3. compound where clauses
> select table1.name
> from table1
> where (table1.age>21 and table1.age<35)
> or (table1.age>50 and table1.age<65)
>
> 4. functions
> select sum(table1.amount) as sum
> from table1
> where table1.amount<5000
>
> 5. group by ... having
> select type, sum(price)
> from titles
> where price <= 5
> group by type
> having sum(price) > 50
>
> 6. sub-queries
> select table1.title)
> from table1
> where table1.price =
> (
> select min(table1.price)
> from table1
> )
>
> select distinct pub_name
> from publishers
> where pub_id not in
> (
> select pub_id
> from titles
> where type='business'
> )
>
> 7. transactions
> begin
> <statement1>
> <statement2>
> <statement3>
> commit
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
-------------------------------------------------
I am Vinz, Vinz Clortho. Keymaster of Gozer,
Volguus Zildrohar, Lord of the Sebouillia.
Are you the Gatekeeper?
-------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]