dbexecute insert (Documentation Bugs and Problems)

by Jim ⌂ @, Russell, KY, Monday, June 09, 2014, 00:58 (1055 days ago) @ DickStomp

Your problem is that the BASIC256 variable 'n' is not understood by SQLite. You need to build your SQL statement using string concatenation. Try this:

dbexecute "create table dicktest1 (id integer, nummer text, value decimal);"
for n = 1 to 3
stmt$ = "insert into dicktest1 (id, nummer, value) values (" + n + ", '" + n + "', " + n + ");"
print stmt$
dbexecute stmt$
next n

You could do it all in one statement but sometimes I like to see the SQL statement before it executes.

Happy programming.

Jim


Complete thread:

 RSS Feed of thread

powered by my little forum