0
CREATE OR REPLACE PROCEDURE LOGINUPDATE 
AS 
BEGIN 
UPDATE 
(select e.status  from EmployeeTest E
INNER Join  SecurityTest S on S.SecurityID=E.EmployeeID and S.SecurityLevel<>'Admin'
INNER Join  LOGINTest    L on E.EmployeeID=L.LoginID and LastLogin < Add_Months(Cast(SysDate as date),25) and E.Status=1
) t
SET t.status = 0
END;


EXECUTE LOGINUPDATE;

Why I can't Execute this procedure ? Can anyone spot the issue ?

Doonie Darkoo
  • 1,475
  • 2
  • 14
  • 33
  • What exactly is the problem? Are you getting an error? – Mureinik Mar 29 '18 at 07:27
  • What happens when you execute it? Does it give any error? See if this link helps: https://stackoverflow.com/a/1856749/259889 Basically your approach to executing procedure may be wrong. – Sid Mar 29 '18 at 07:27
  • Yes I get error of Invalid SQL command – Doonie Darkoo Mar 29 '18 at 07:30
  • This is **the same question** as [the one which you have just deleted](https://stackoverflow.com/q/49549803/146325). It was a duplicate then and it is a duplicate now. – APC Mar 29 '18 at 07:34
  • That won't even compile as shown. Are you running everything you've shown as one script - and how, through which client or application? (There is no semicolon at the end of the uodate, which probably won't work as per APC; and you may need a slash between `end` and `execute`, assuming you're using a client that can handle that - the error suggests not...) – Alex Poole Mar 29 '18 at 07:34
  • 2
    `Cast(SysDate as date)` is unnecessary. `SYSDATE` is already a `DATE` – Kaushik Nayak Mar 29 '18 at 07:36

0 Answers0