Manish Kumar
04/23/2021, 7:54 AMconst { SEDOL } = args;
// EventCD NOT IN ('DIV' , 'DRIP') and SEDOL = ? and PrimaryExchgCD = ExchgCD"
const whereCondition = {
SEDOL,
EventCD: {
not: {
in: ["DIV", "DRIP"],
},
},
};Robert Witchell
04/23/2021, 7:57 AMPrimaryExchgCD a property? what is ExchgCD? a var?Manish Kumar
04/23/2021, 8:05 AMPrimaryExchgCD, ExchgCD are column names in mysql table.Robert Witchell
04/23/2021, 8:08 AMwhere: {
AND: [
{EventCD: here},
{PrimaryExchangeCD: {equals: {ExchangeCD}}},
SEDOL,
],
}Manish Kumar
04/23/2021, 8:20 AMExchangeCD is getting evaluated as a value here but I want to treat it as a column name which will be evaluated by mysql query later.Robert Witchell
04/23/2021, 8:21 AMRobert Witchell
04/23/2021, 8:23 AMnew PrismaClient({log: [
'query',
{
emit: 'event',
level: 'query',
},
],})Manish Kumar
04/23/2021, 8:26 AMQuery: {
description: async (parent, args, ctx, info) => {
console.log(parent);
const { identifier, identifierVal } = args;
// ListStatus <> 'D' and ActFlag <> 'D'
const data = await ctx.prisma.eDI_SecurityMasterVMS.findFirst({
where: {
[identifier]: identifierVal,
ListStatus: {
not: "D",
},
Actflag: {
not: "D",
},
PrimaryExchgCD: { equals: { ExchgCD } },
},
});
}
I dont see any log in console as the query is not successfull because of ExchgCD being undefinedManish Kumar
04/23/2021, 8:32 AMPrimaryExchgCD: { equals: { ExchgCD } } from where condition.
`SELECT vms.EDI_SecurityMasterVMS.ScexhID, vms.EDI_SecurityMasterVMS.SedolID, vms.EDI_SecurityMasterVMS.Actflag, vms.EDI_SecurityMasterVMS.Changed, vms.EDI_SecurityMasterVMS.Created, vms.EDI_SecurityMasterVMS.SecID, vms.EDI_SecurityMasterVMS.IssID, vms.EDI_SecurityMasterVMS.ISIN, vms.EDI_SecurityMasterVMS.CUSIP, vms.EDI_SecurityMasterVMS.IssuerName, vms.EDI_SecurityMasterVMS.CntryofIncorp, vms.EDI_SecurityMasterVMS.SIC, vms.EDI_SecurityMasterVMS.CIK, vms.EDI_SecurityMasterVMS.IndusID, vms.EDI_SecurityMasterVMS.SectyCD, vms.EDI_SecurityMasterVMS.SecurityDesc, vms.EDI_SecurityMasterVMS.ParValue, vms.EDI_SecurityMasterVMS.PVCurrency, vms.EDI_SecurityMasterVMS.StatusFlag, vms.EDI_SecurityMasterVMS.PrimaryExchgCD, vms.EDI_SecurityMasterVMS.SEDOL, vms.EDI_SecurityMasterVMS.SedolCurrency, vms.EDI_SecurityMasterVMS.Defunct, vms.EDI_SecurityMasterVMS.SedolRegCntry, vms.EDI_SecurityMasterVMS.StructCD, vms.EDI_SecurityMasterVMS.ExchgCntry, vms.EDI_SecurityMasterVMS.ExchgCD, vms.EDI_SecurityMasterVMS.MIC, vms.EDI_SecurityMasterVMS.Micseg, vms.EDI_SecurityMasterVMS.LocalCode, vms.EDI_SecurityMasterVMS.ListStatus, vms.EDI_SecurityMasterVMS.SharesOutstanding, vms.EDI_SecurityMasterVMS.EffectiveDate FROM vms.EDI_SecurityMasterVMS WHERE (vms.EDI_SecurityMasterVMS.CUSIP = ? AND vms.EDI_SecurityMasterVMS.ListStatus <> ? AND vms.EDI_SecurityMasterVMS.Actflag <> ?) LIMIT ? OFFSET ?`