Maximo Open Forum

 View Only
  • 1.  how to change ibm maximo workorder status from comp to close using sql scripting

    Posted 10-12-2024 09:25

    how to change  ibm maximo workorder status from comp to close  using sql scripting my  database is sql server


    #WorkManagement

    ------------------------------
    nasr buzaid
    eni
    ------------------------------


  • 2.  RE: how to change ibm maximo workorder status from comp to close using sql scripting

    Posted 10-13-2024 18:17

    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
    ------------------------------



  • 3.  RE: how to change ibm maximo workorder status from comp to close using sql scripting

    Posted 05-23-2025 21:45

    thank you



    ------------------------------
    nasr buzaid
    eni
    ------------------------------



  • 4.  RE: how to change ibm maximo workorder status from comp to close using sql scripting

    Posted 02-18-2025 12:36

    If you change the work order status, there's at least another table called wostatus that shows the history of status changes. By updating the status in workorder directly, you would not do everything that Maximo does on the front end. How about using an escalation instead? Are you trying to close out COMP work orders after a certain period? You could add that logic to the escalation.

    https://www.ibm.com/support/pages/using-escalations-close-completed-work-orders



    ------------------------------
    sun kim
    ------------------------------



  • 5.  RE: how to change ibm maximo workorder status from comp to close using sql scripting

    Posted 02-19-2025 03:33
    Edited by John Yong 02-19-2025 03:43

    I don't recommend  change status WO with query.

    I suggest using query + escalation.

    1. Update the workorder with a query.
        )update workorder

        set CHECKAUTOCLOSE = 1

        where wonum='ZZZ'

        and siteid='AAA';

    2. Add "CHECKAUTOCLOSE = 1" to the 'workorder Close escalation' condition.

     (https://www.ibm.com/support/pages/using-escalations-close-completed-work-orders) 



    ------------------------------
    John Yong
    ------------------------------