Re: [ROOT] TSQLServer::Query enhancement request

From: Pasha Murat (murat@fnal.gov)
Date: Wed Mar 06 2002 - 19:55:00 MET


On Wed, 06 Mar 2002 17:14:18 +0100
"Christian Holm Christensen" <cholm@hehi03.nbi.dk> wrote:

> Hi Anton, Fons, et al
> 
> On Wed, 6 Mar 2002 15:41:07 +0100
> anton.fokin@nl.fortisbank.com wrote
> concerning "[ROOT] TSQLServer::Query enhancement request":
> > Hi Fons et.al.,
> > 
> > could you enhance SQLServer::Query() so that it takes format string and an
> > optional list of parameters lke printf().
> > 
> > SQLServer::Query("DELETE FROM stock WHERE name = %s", Stock->GetName());
> 
> 
> I think a better thing would be to have a TSQLQuery class, and all
> the Query methods could accept this kind of object as an argument.   
> 

just a quick comment: as SQL query is inherently a text string, I'm not sure 
what value a new class would add - any class representing a text string 
(including TString) seems to be qute sufficient. I think it is always better 
to keep an interface (to everything, including relational DB's) as thin as 
possible and not to invent a new language where the existing one would 
suffice..
	Anton's sugestion is nice, and if most of what you're coding is the
DB queries, you'd really like to have exactly this form of the interface.
However for all the practical purposes `Form` addresses the need in [may be] 
a little bit less elegant but the same little bit more general way.

						-best, Pasha



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:44 MET