(no subject)

Hi all,

with following fields

apigroup_name=production ------> (single table)
loginid=43
[email protected]

clientapp= ActiveRecord::Base.connection.execute(“SELECT
sdm_users.loginid,sdm_users.id,sdm_users.email,api_groups.name,api_groups.is_autokey_generate,api_groups.id
FROM sdm_users,api_groups WHERE sdm_users.loginid =’#{loginid}’
&&
sdm_users.status = true && api_groups.name=
(’#{apigroup_name}’)”)

By the above query i can retrieve all fields from db,

What i want to do now is to
apigroup_name=[“production”,“marketing”] ------> (multiple
table)

loginid=43

[email protected]

want to retrieve all the fields from db,

clientapp= ActiveRecord::Base.connection.execute(“SELECT
sdm_users.loginid,sdm_users.id,sdm_users.email,api_groups.name,api_groups.is_autokey_generate,api_groups.id
FROM sdm_users,api_groups WHERE sdm_users.loginid
=’#{loginid}’ && sdm_users.status = true && api_groups.name IN
(’#{apigroup_name}’)”)

it is not working can anybody help me

clientapp= ActiveRecord::Base.connection.execute(“SELECT
sdm_users.loginid,sdm_users.id,sdm_users.email,api_groups.name,api_groups.is_autokey_generate,api_groups.id
FROM sdm_users,api_groups WHERE sdm_users.loginid =’#{loginid}’ &&
sdm_users.status = true && api_groups.name IN (’#{apigroup_name}’)”)

it is not working can anybody help me
Your in clause needs to look like in (‘value1’, ‘value2’)
But why use such a low level api when you could use something much
nicer?

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs