I have the following SQL statement and I keep receiving and ORA-00933: SQL command not properly ended at Line:8 Column:86, (right after "group by userid)" and for the life of me I cannot see why. mI am using SQLPlus in Oracle
update imw.users a
set user_status_cd ='DISABLED',
updated_by_id =1043,
last_admin_id =1043,
updated_dt = sysdate,
update_rmks_tx = (SELECT 'Disabled due to inactivity- Last logon ' || max(login_dt) || '- To enable this account contact your Program Manager (or State Admin). If no further activity is encountered, this account will be deleted in 60 days.'
FROM imw.logins b WHERE a.userid = b.userid)
where exists (select userid, max(login_dt) logindt from imw.logins l group by userid) c
where c.userid = a.userid and lastlogin <sysdate-30);
The select in the where clause is from the below statement that selects users that I need to disable and select 1700 users. I need to be able to disable these same users and that is what I am trying to do with ths statement
Thanks for any assist you can give.
Richard