Inserting from an array
See original GitHub issueIt took me ages to find this syntax:
// Inserting an array (from a previous query) into Product table
//db.tables.Product.data = data is elegant, but how to use it with varying table names ?
myTable = "Product";
db.exec('INSERT INTO ' + myTable + ' SELECT * FROM ?',[data]); // That's THE syntax !!
//Guessed from https://github.com/agershun/alasql/wiki/Insert
(my 2 к. - sorry if it was obvious)
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
C program to Insert an element in an Array - GeeksforGeeks
First get the element to be inserted, say x · Then get the position at which this element is to be inserted, say...
Read more >How to insert an item into an array at a specific index ...
You want the splice function on the native array object. arr.splice(index, 0, item); will insert item into arr at the specified index (deleting...
Read more >Array Insertions - Tutorialspoint
When the insertion happens at the beginning, it causes all the existing data items to shift one step downward. Here, we design and...
Read more >array.insert() - Dev Center - Electric Imp
This method places the value passed as its first parameter into the target array at the specified index, which can be zero —...
Read more >Insert an element at a particular index in an array - Log2Base2
To insert an element at a particular index in an array, we need to Shift all the elements from last index to position...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use three different methods to insert data from array into table:
BTW: If you download data from external file, you can use this syntax:
IndexedDB will not work with this.