Skip to content

Tag: sql

SQL Trigger – Having one is messing up new SQL queries

I am able to manually execute the following code: However, if I try creating a Trigger with the same code as above, I get this error when creating a new user in my database: Can’t update table ‘members’ in stored function/trigger because it is already used by statement which invoked this sto…

how to sanitize sql.js inputs?

I am using sql.js to manage the SQLite file I created for an electron app. My issue is that I want to make sure all the inputs are sanitized. As of now, I am using statements like so: I’m pretty sure that this way is unsafe and can cause SQL injections. What can I do to prevent such a problem?

How to convert X items into array and looping

I have a table with 100k records. I want to create an array for each 10k items and loop this, i.e. first 10k items-> array(first 10k items), then seconds array(10k different items), then third and so on. In other words, each array contains 10k different records. This is what I tried: This is the error I ge…