Hello to all:
I have this request:
SELECT code_statusfac FROM factures WHERE code_statusfac in (:FILTRE)
While :FILTRE that can equal to some value, example:
' DIS02 ', ' DIS03 ', ' DIS04 ', etc.
When I execute the request and I replace:FILTRE by DIS04 that works well, but when I want to allocate him some value at the same moment it costs not.
What is what you have ideas PLEASE.
Thank you in advance.
Simple answer is use dynmaic query...
But be cautious about sql injection & other security concerns (it needs SELECT permission the table object).
Code Snippet
Exec ('SELECT code_statusfac FROM factures WHERE code_statusfac in (' + @.ListOfValues + ')')
No comments:
Post a Comment