[Mono-list] SQL Parser for System.Data

Paolo Molaro lupus@ximian.com
Sat, 11 May 2002 16:03:49 +0200

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.


lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better