CA Service Management

Expand all | Collapse all

sql script error to copy from usp_contact to ca_contact

  • 1.  sql script error to copy from usp_contact to ca_contact

    Broadcom Employee
    Posted 06-05-2018 07:29 AM

    CA Service Desk Manager version: 17.1 /sql2012

    Hi All

    i import the supervisor information from ldap as per below

     

    1- create zldap.mod with below code

    OBJECT ldap LDAP {
    ATTRIBUTES LDAP_Entry{
    zsupervisor manager STRING ;
    } ;
    } ;

    2- run pdm_ldap_import

    3- RUN SQL script  

    information are imported as expected however i need to copy the uuid in ca_contact so when i try to run the below command on sql which i used in many places till 14.1 , its giving me the error

    SQL script 

    UPDATE ca_contact
    SET supervisor_contact_uuid = susp.contact_uuid
    FROM ca_contact AS ca INNER JOIN usp_contact AS usp ON ca.contact_uuid = usp.contact_uuid , usp_contact AS susp
    Where usp.zsupervisor = susp.ldap_dn

     

    Error

    Msg 547, Level 16, State 0, Line 1
    The UPDATE statement conflicted with the FOREIGN KEY SAME TABLE constraint "ininjoin01". The conflict occurred in database "mdb", table "dbo.ca_contact", column 'contact_uuid'.
    The statement has been terminated.

     

    any suggestion 



  • 2.  Re: sql script error to copy from usp_contact to ca_contact

    Broadcom Employee
    Posted 06-05-2018 08:19 AM

    Hi Arif,

     

    I see some difference in code that you mentioned here. Can you validate and test this code as below

     

    UPDATE dbo.ca_contact
    SET supervisor_contact_uuid = susp.contact_uuid
    FROM dbo.ca_contact AS ca
    INNER JOIN dbo.usp_contact AS usp ON ca.contact_uuid = usp.contact_uuid
    INNER JOIN dbo.usp_contact AS susp ON usp.z_supervisor_ldap_dn = super.ldap_dn
    WHERE ca.inactive = 0

     

    Note: SDM service restart is required*