From 522a3b1be008830f5f502c6aa9767a1308aa3786 Mon Sep 17 00:00:00 2001 From: Arne Morken Date: Fri, 10 Jan 2025 17:05:51 +0100 Subject: [PATCH] dbUpdateLinkList() bugfix --- data/alasql/anyTable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/alasql/anyTable.js b/data/alasql/anyTable.js index 42e7496..46fcba1 100644 --- a/data/alasql/anyTable.js +++ b/data/alasql/anyTable.js @@ -1844,7 +1844,7 @@ anyTable.prototype.dbUpdateLinkList = async function(options) if (delval) { let stmt = "UPDATE " + this.tableName + " " + "SET parent_id=NULL " + - "WHERE " + id_key + "=" + delval + ""; + "WHERE " + id_key + "=" + id + ""; //console.log("dbUpdateLinkList(4):"+stmt); await alasql.promise(stmt); } @@ -1855,8 +1855,8 @@ anyTable.prototype.dbUpdateLinkList = async function(options) for (const updval of inslist) { if (updval && updval != id) { let stmt = "UPDATE " + this.tableName + " " + - "SET parent_id=" + id + " " + - "WHERE " + id_key + "=" + updval + ""; + "SET parent_id=" + updval + " " + + "WHERE " + id_key + "=" + id + ""; //console.log("dbUpdateLinkList(5):"+stmt); await alasql.promise(stmt); }