Closed elhananjair closed 1 year ago
I am trying to run a delete query, I have an array that contains values to delete from the table, but it is not deleting.
let totalNum = [] //this contains an array of numbers //e.g totalNum = [122, 322, 424, 233]; async function deleteNum(){ try { totalNum.map(async num => await sql`delete from mytable.numlist where digit = ${ num } returning digit`) } catch (e) { console.log("Error Found: " + e.message) } } deleteNum().catch(e => console.log(e));
It is not deleting from the table, what am I missing here?
@elhananjair this code is in which file?
Please assign it to me I will solve it
it seems there was some issue with my async await implementation, it works now.
I am trying to run a delete query, I have an array that contains values to delete from the table, but it is not deleting.
It is not deleting from the table, what am I missing here?