samedi 30 janvier 2016

Populating SQLite table with Tcl script in SQLiteStudio

I'm trying to populate two INTEGER fields of a table in SQLite Studio with Tcl script feature of SQLiteStudio. The table itself is a representation of a m✕n rectangular matrix, where those two fields represent elements' indices.

I've tried to recreate a surrogate for loop with the following script for the first field:

set i 0
set i [expr {$i==100?1:$i+1}]

and this script for the second one:

set j 0
set j [expr {$i==100?$j+1:$j}]

While the first script populates field i normally, the second one displays Error while executing populating code: can't read "i": no such variable error message, and the j field is populated with null values.

Is there any way to use SQLiteStudio's population mechanism this way (i.e. accessing field's new value from scope of another field's population Tcl script)?

Aucun commentaire:

Enregistrer un commentaire