18 lines
710 B
Plaintext
18 lines
710 B
Plaintext
sqliteconnect #mem, ":memory:" ' create in memory db
|
|
mem$ = "CREATE TABLE people(num integer, name text,city text)"
|
|
#mem execute(mem$)
|
|
data "1","George","Redding","2","Fred","Oregon","3","Ben","Seneca","4","Steve","Fargo","5","Frank","Houston"
|
|
|
|
for i = 1 to 5 ' read data and place in memory DB
|
|
read num$ :read name$: read city$
|
|
#mem execute("INSERT INTO people VALUES(";num$;",'";name$;"','";city$;"')")
|
|
next i
|
|
#mem execute("SELECT * FROM people ORDER BY name") 'sort by name order
|
|
WHILE #mem hasanswer()
|
|
#row = #mem #nextrow()
|
|
num = #row num()
|
|
name$ = #row name$()
|
|
city$ = #row city$()
|
|
print num;" ";name$;" ";city$
|
|
WEND
|