internal DdrLister buildAddSecurityKeyByNameQuery(string securityKeyName, string duz)
{
// Can't use DDR FILER because the underlying M function requires 2 arrays and the
// broker can only do 1.
// Idea is to make a query that is guaranteed to find a record, then use the identifier
// argument to add the new record.
DdrLister query = new DdrLister(cxn);
query.File = "19.1";
query.Fields = ".01";
query.Flags = "IP";
query.From = VistaUtils.adjustForNameSearch(securityKeyName);
query.Part = securityKeyName;
query.Xref = "B";
query.Id = "X \"S XQKUS=" + duz + " S XQKEY=$P(^(0),U,1) S XQKF=0 D ADD^XQKEY(XQKUS,XQKEY,XQKF) D EN^DDIOL(XQKF)\"";
return query;
}