EscapeString paramters

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Aug 6 22:28:30 CDT 2004


On 8/6/04 9:26 PM, "jda" <jda at his.com> wrote:

>> I think that you can try to use instead SQL BINDING.
>> This will do work easier and faster.
>> 
>> In the SQL folders you can find example Binding.
>> 
> 
> Hm, I don't see how I would use this for searching indexes
> indexedbyword. 

Easy

You write not 

    s = Valentina.EscapeString("O'Shea", false)
    q = "select ... WHERE fld = '" + s + "'"

    db.SqlSelect(  q )


With bind you can write:

    q = "select ... WHERE fld = :1"

    arr.addItem( "O'Shea" )

    db.SqlSelect( q, arr );

We win here that 
1) we do not do escape string, instead ZERO TIME
2) we do not concatenate query string, instead ZERO TIME.
3) parser work on smaller query string, so less time.
4) parser do not convert escaped string back, instead ZERO time.


> But it does bring up a question about .escsapescring:

> If I do a SQL search of an indexed (by word) field, it's for the name
> O'Shea, would I first
> 
> s = Valentina.EscapeString("O'Shea", false)

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina-beta mailing list