on 11-25-2009 11:42 AM
Hi All,
I am using Fixed Query as blow.
Select username from users where userid in (1,2,3,4,5,6);
Select username from users where userid in '[Param.1]'
I am setting Param.1 = 1,2,3,4,5,6 but it is not working.
Could you please help me to solve the issue?
Regards,
Sachin
Hi Sachin,
I am using a list and an IN clause with SQL Server like this:
select security_assignments_vw.security_token, security_assignments_vw.security_token_type
from security_assignments_vw
where security_assignments_vw.security_role in ([Param.1])
the value in Param.1 is actually the IllumLoginRoles which in the case of my user id is:
'XMII Developers','XMII Administrators','XMII Users','XMII Managers','XMII Operators'
Note the single quotes around each value as the roles are in a varchar column.
If your user ids are also varchar values, the SQL would require single quotes
around the values like this: '1','2','3','4','5','6'
What is the error you are getting?
Hope this helps,
--Amy Smith
--Haworth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just on the face of it, you are missing the parentheses. It should look like:
Select username from users where userid in '[Param.1]'
and Param.1 should be (1,2,3,4,5)
or perhaps
Select username from users where userid in ([Param.1])
and Param.1 should be 1,2,3,4,5
Test it but the end result of your script needs those parentheses.
Good luck,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.