G
Guest
hi
When Calling a StoredProc, with a Parameter, where the parameter is a list
applied against an "IN" clause,
eg
In Code, ... mycommand.Parameters("@sP1_Id").Value = " 'A','B' "
StoredProc xxxx (@sP1_Id as varchar 32)
....
...Select..
...From
...Where SomeField IN (@sP1_Id)
....
When i run the app
Nothing gets returned..??
Debuging shows the value of @sP1_Id as it enters the StoredProc as 'A','B'
and if I plug them straight in ..ie
...WHERE SomeField IN ('A','B') then it works fine.
Trying "A,B" definitely won't ... and doesn't work.
SO somehow the parameter, is not being seen correctly...the single quotes
and/or comma may be reponsible as... if I only use one item in the IN clauses
List, it works fine.
Is there a way to do this or must I find a work around.
TIA
Neal
When Calling a StoredProc, with a Parameter, where the parameter is a list
applied against an "IN" clause,
eg
In Code, ... mycommand.Parameters("@sP1_Id").Value = " 'A','B' "
StoredProc xxxx (@sP1_Id as varchar 32)
....
...Select..
...From
...Where SomeField IN (@sP1_Id)
....
When i run the app
Nothing gets returned..??
Debuging shows the value of @sP1_Id as it enters the StoredProc as 'A','B'
and if I plug them straight in ..ie
...WHERE SomeField IN ('A','B') then it works fine.
Trying "A,B" definitely won't ... and doesn't work.
SO somehow the parameter, is not being seen correctly...the single quotes
and/or comma may be reponsible as... if I only use one item in the IN clauses
List, it works fine.
Is there a way to do this or must I find a work around.
TIA
Neal