Saturday, 16 March 2019

Node-Mysql catching empty data on Update

Good day everyone. how to catch empty data on UPDATE in mysql node module yung their shorthand sytanx like "SET ?"I want to do nothing if the object or object key is empty. I prefer to do this checking in mysql script. here is my code```let query = 'UPDATE `BillerReport` INNER JOIN `BillerReportPayment` ON (BillerReport.id = BillerReportPayment.billerReportId) SET ? WHERE BillerReportPayment.refNo = ?';let counter = result.getBillerReportCount.count;​let data = {responseBody: JSON.stringify(this.req.body.responsePosting)}let addBillerReportPaymentReference = APILogMySQL.execute(query, [data, this.req.params.refNo]);```

Submitted March 17, 2019 at 05:23AM by makopa_fruit

No comments:

Post a Comment