Generate commands for SQL transaction using Tcl and sqlite
I am having trouble understanding how to create a batch of SQL commands in a list and pass it to sqlite to execute a transaction.
Basically what I am doing right now:
sqlite3 db1 $dbFile
db1 eval BEGIN
foreach Key [array names myArray] {
db1 eval {SQL statement involving $Key}
}
db1 eval COMMIT
I was thinking about how to create a list with SQL INSERT and then pipe it to db1 or db1 eval transactions, but that doesn't seem to work for me. Maybe I'm just doing some syndicated stupin mistakes. Does anyone have a working example?
Thanks!
+2
a source to share