2 replies
by vayrella Accepted solution
by tony hopkinson Accepted solution
I can think of several things you could be asking.
Don't know which one you mean though.
If you are talking about building a query from an array, (e.g a number of columns to select), or a number of values for a where clause, remember these.
There could be none or one or effectively unlimited.
The order of the items..
If your query is
Where A = Value[0] or A = Value[1]
no problem.
if it were
Where A = Value[0] or B = Value[1]
It's isn't an array. For that sort of thing you'd be better off with a Dictionary. Go too far down that route though and you've just reinvented SQL.
Personally I'd write a function for each query unless there was some major design consideration not to. Give them nice names. Easier to read , change and debug.
I six months time when you have to revisit this code. Do you want to see
DoQuery(["Fred", "Wilma"])
Or
GetChildren(Husband, Wife)
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending