U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ SQL » OleDB + parameters = problem
Re: OleDB + parameters = problem [message #19793 is a reply to message #19789] Wed, 21 January 2009 14:14 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Novo wrote on Tue, 20 January 2009 17:34


I haven't check how SqlExp with explicit params works, but using parameters with SQL is very important. If you aren't using parameters, then server has to parse your SQL all the time. And very often parsing (and creating an execution plan) is more expensive than executing itself.



Well, have you benchmarked? I have stopped using precompiled Sql expressions when I noticed there is no difference you can really feel.

It might be useful for some very corner cases like when you are querying single value from single table; in all other cases, pushing data over network witll nullify any advantage you can gain by keeping your statement preparsed.

OTOH, it is still supported. Note also that one nice way how to keep very frequent SQL statements precompiled on the server is to have them static:

void Test::remove_person(void)
{
    static Sql stmt("DELETE FROM person WHERE id = ?");


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to use Sql * Update
Next Topic: Conditional jump or move depends on uninitialised value(s)
Goto Forum:
  


Current Time: Wed Sep 02 23:18:18 GMT+2 2026

Total time taken to generate the page: 0.00632 seconds