dbexecute insert (Documentation Bugs and Problems)

by DickStomp ⌂ @, Europe Netherlands Sassenheim, Monday, June 09, 2014, 19:10 (1055 days ago) @ Jim

Jim, thank you very much!
Finally results a good working program SQLTEST.KBS:
***************************************************
print "database open"
dbopen "dbtest.db"

print "vorige dicktest1 opruimen"
onerror errortrap
dbexecute "drop table dicktest1;"
offerror

print "nieuwe dicktest1 aanmaken"
dbexecute "create table dicktest1 (id integer, nummer text, value decimal);"

print "tabel vullen"
for n = 1 to 3
print " + n + "
stmt$ = "insert into dicktest1 (id, nummer, value) values (" + n + ", '" + n + "', " + n + ");"
dbexecute stmt$
print stmt$
next n

print "sluit tabel"
dbcloseset

print "teruglezen = read back"

print "open dicktest1"
onerror opvanger
dbopenset "select * from dicktest1 order by nummer;"
print "lezen tot eind set"
while dbrow()
print "?";
print dbint(0) + dbstring(1) + dbfloat(2)
end while
offerror
print "eind set"

print "sluit tabel"
dbcloseset

print "sluit database"
dbclose

print "eind programma"
end

errortrap:
# 't is goed, ga gewoon verder =
# it's ok, carry on
return

# Dit is de vriendelijke fout 'opvanger'
opvanger:
print "Fout opgevangen - op lijn " + lasterrorline + " - foutnummer " + lasterror + " boodschap: " + lasterrormessage + " (" + lasterrorextra + ")"
return

--
it must be possible...


Complete thread:

 RSS Feed of thread

powered by my little forum