Hi @nasr buzaid!
Obviously, I always recommend doing the WO closing process through Maximo, since it is difficult to answer and probably without knowing the customs that the system may have. When doing it through the database, it is possible to make mistakes and have inconsistent data, since you have to see if the WO depends on a preventive maintenance, if there are associated costs, tasks, child WOs, etc. etc.
It is assumed that if a WO that has tasks or child WOs is closed, these should also be closed. Right? Saying this:
Let's imagine this example:
WO number = WO-12345
WO site = SITE-WO
Organization = ORG-WO
- update workorder set historyflag = 1, status = 'CLOSE' where (wonum = 'WO-12345' and orgid = 'ORG-WO' and siteid = 'SITE-WO')
- update workview set historyflag = 1, status = 'CLOSE' where (recordkey = 'WO-12345' and orgid = 'ORG-WO' and siteid = 'SITE-WO')
With this it will be closed, but it will not update all the data that is updated when Maximo does it, that is why I do not recommend doing it (for example, the last WOSTATUS record of that WO will not be CLOSE, this being an inconsistency).
You should then add one last record in WOSTATUS to resolve that inconsistency:
- insert into wostatus (wostatusid, wonum, status, changedate, siteid, orgid) values (WOSTATUSSEQ.NEXTVAL, 'WO-12345', 'CLOSE', CURRENT_TIMESTAMP, 'SITE-WO', 'ORG-WO');
Regards!
------------------------------
Martin Fabra
ARSAT S.A. - Actively seeking employment
------------------------------
Original Message:
Sent: 10-12-2024 09:24
From: nasr buzaid
Subject: how to change ibm maximo workorder status from comp to close using sql scripting
how to change ibm maximo workorder status from comp to close using sql scripting my database is sql server
#WorkManagement
------------------------------
nasr buzaid
eni
------------------------------