Subject | Re: Custom search string |
---|---|
Author | Ali Gökçen |
Post date | 2005-05-02T12:50:05Z |
Grant,
sql creation, preparing in my opinion.
i wrote as false because i didn't know your true/false interpretion.
(:X = 0 or text1 = :T1) runs very fast in both posibilites.
(:X=0 or text1=:T1) means of do search for :T1 only when :X=true.
i wrote this logic because you want use this query in stored
procedure if i understand correctly.
instead of dynamic comlexity.
Regards,
Ali
>all
> If I do it this way I then need to set up an if statement to cover
> possibilitys for all 10 input variables. That would be a fairlylarge if
> statement.10 posibility and 10*2 prameters is not more expensive than dynamic
sql creation, preparing in my opinion.
i wrote as false because i didn't know your true/false interpretion.
(:X = 0 or text1 = :T1) runs very fast in both posibilites.
>to say
> >if X = true then ABC.SQL.Add('and Text1= :T1);
>
> In this case the X is not a variable to search on its just a flag
> "please add T1 to the search string"Yup, i know, i wrote the sql in draft mode.
(:X=0 or text1=:T1) means of do search for :T1 only when :X=true.
i wrote this logic because you want use this query in stored
procedure if i understand correctly.
>string.
> If X = false then T1 does not become even part of the SQL search
>It is no so much saving i thing, i were u, i prefer clean code
instead of dynamic comlexity.
Regards,
Ali