[Mono-list] SQL Parser for System.Data

Rodrigo Moya rodrigo@ximian.com
11 May 2002 16:47:53 +0200


On Sat, 2002-05-11 at 16:03, Paolo Molaro wrote:
> On 05/11/02 Piers Haken wrote:
> > But this breaks the whole idea of prepared statements: where you prepare
> > a statement in the database and then bind the parameters to it on each
> > call.
> > 
> > I don't know about other databases but I know that for MS SQL, there's a
> > significant performance gain in preparing a statement and then calling
> > it multiple times, as opposed to just calling an ad-hoc statement
> > multiple times. As far as I know it's essentially creating a stored
> > procedure out of the statement.
> > 
> > If you do the parameter replacement on the client side then you lose all
> > this benefit. The whole idea of SqlParameter is that the parameter
> > replacement is done by the DBMS.
> 
> I think the issue here is twofold:
> *) you may need to detect if a SWL statement needs to have parameters
> *) postgres doesn't support prepared statements directly, but we still
> want (or need if the interface mandates it) support the concept, so, for
> postgres and others db like it, we need the SQL statement parser in the
> client code.
> 
exactly.

cheers