vishnu kalakota
asked on
how to insert and display data in sqlite3 using bash?
i have three variables holding information
var1=CSI6221 Project 1 2015 Semester 1
var2=WED
var3=12:30 - 13:30
var4=ML 03.102 Tutorial Room
sqlite3 test.db "create table timetable_info (ID INTEGER
PRIMARY KEY,unitinfo TEXT,day TEXT,time TEXT,location TEXT);" ### created a table like this
sqlite3 test.db "insert into timetable_info (unitinfo,day,time,room) values ('$var1', '$var2', '$var3' '$var4');" inserted values this way.
sqlite3 test.db "select * from timetable_info;" ### i tried to display data..
i ended up with the message Error:::: near "'ML 03.102 Tutorial Room'": syntax error
can any help what this means?
thank you
var1=CSI6221 Project 1 2015 Semester 1
var2=WED
var3=12:30 - 13:30
var4=ML 03.102 Tutorial Room
sqlite3 test.db "create table timetable_info (ID INTEGER
PRIMARY KEY,unitinfo TEXT,day TEXT,time TEXT,location TEXT);" ### created a table like this
sqlite3 test.db "insert into timetable_info (unitinfo,day,time,room) values ('$var1', '$var2', '$var3' '$var4');" inserted values this way.
sqlite3 test.db "select * from timetable_info;" ### i tried to display data..
i ended up with the message Error:::: near "'ML 03.102 Tutorial Room'": syntax error
can any help what this means?
thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Stuck with the silly mistake since couple of days..
thanks very much...
thanks very much...
var1="CSI6221 Project 1 2015 Semester 1"
var2="WED"
var3="12:30 - 13:30"
var4="ML 03.102 Tutorial Room"