Be aware that not every connector has a diagram link row by default. This is yet another inconsistency to diagram objects. Before changing the diagram link via SQL make sure that the diagram link for your connector and specific diagram really exists. If this is not the case, you can create the link via code.
We do this for similar use cases (in this case bend point application to connectors) like shown below. The importance piece is the logic plus the insert query, which took me quite some time to get it accepted by EA.
public void changeConnectorLayout(IDualConnector conn, int diagramID, IEnumerable<Point> bendPoints = null)
{
string diagramLinkAvailableQuery = "SELECT ConnectorID FROM t_diagramlinks WHERE ConnectorID=" + conn.ConnectorID + " AND DiagramID=" + diagramID;
string linkAvailable = EAFacade.RetrievalCore.getFieldByQuery(diagramLinkAvailableQuery, "ConnectorID");
if (linkAvailable == null)
{
string insertDiagramLinkSQL = "INSERT INTO t_diagramlinks(DiagramID, ConnectorID, Geometry, Style, Hidden) " +
"VALUES(" + diagramID + "," + conn.ConnectorID + @",'EDGE=1;$LLB=;LLT=;LMT=;LMB=;LRT=;LRB=;IRHS=;ILHS=;','Mode=3;Color=-1;LWidth=0;Tree=OR;',False)";
EAFacade.rep.Execute(insertDiagramLinkSQL);
changeConnectorLayout(conn, diagramID, bendPoints);
}
else
{
ConnectorLayout layout = new ConnectorLayout(conn.ConnectorID, diagramID);
layout.Create();
string newStyleSQL = layout.GetStyleDBString();
string newGeometrySQL = layout.GetGeometryDBString();
string newBendPoints = layout.SetBendPoints(bendPoints.ToList());
string setBendPointsSQL = "UPDATE t_diagramlinks SET Style='" + newStyleSQL + "', Geometry='" + newGeometrySQL + "', Path='" + newBendPoints + "' WHERE DiagramID=" + diagramID + " AND ConnectorID=" + conn.ConnectorID;
EAFacade.rep.Execute(setBendPointsSQL);
}
}