Clarity

  • 1.  Complex Update Query in SQL

    Posted Nov 15, 2016 09:04 AM

    Hello there,

     

    I am developing an Update query in SQL whereby the Booking Managers will be directly updated from the LDAP directory and replace the old values. So, I need the correct Update query syntax for this please. For example:

     

    update A

    set A.fieldname = B.fieldname

    where B. fieldname = C.fieldname

     

    and something similar with a few DB Tables. So, is it possible to insert a FROM or a JOIN clause within this Update query just before the WHERE clause?

     

    Thanks,

     

    Suhail.



  • 2.  Re: Complex Update Query in SQL

    Posted Nov 21, 2016 08:49 AM

    Have you looked into making this update via gel script and/or XOG?  Direct database updates are not supported by CA and not necessary in this case.  With a gel script you can write a simple SQL query to pull the manager's ID and then update the resource(s) via XOG in the gel.  We do something similar on a daily basis querying for resources whose Booking Manager is not the same as their Manager.