我正在执行此查询:SELECT univ._id, univ.firstName, univ.lastName, univ.status, univ.veikla, univ.cellPhone, univ.homePhone FROM universitetas univ"
以便从名为sql.xml的xml文件中选择id,first name,last name等信息,如下所示:
<sql>
<statement>
CREATE TABLE IF NOT EXISTS universitetas (
_id INTEGER PRIMARY KEY AUTOINCREMENT,
firstName VARCHAR(50),
lastName VARCHAR(50),
status VARCHAR(50),
veikla VARCHAR(50),
city VARCHAR(50),
cellPhone VARCHAR(30),
homePhone VARCHAR(30),
email VARCHAR(30))
</statement>
<statement>INSERT INTO universitetas VALUES(1,'Martin','Tubis','Studentas','Pirmas kursas', 'Vilnius','+370 654 09353','242 74 03','martintubis@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(2,'Petras','Petraitis','Studentas','Pirmas kursas','Vilnius', '+370 654 09463','222 76 43','petrapetratis@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(3,'Jonas','Jonaitis','Destytojas','Matematikos destytojas','Vilnius','+370 654 09853','246 65 63','jonasjonaitis@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(4,'Darius','Petraitis','Dekanas','Dekanatas','Vilnius', '+370 654 12453','248 65 26','dariuspetraitis@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(5,'Simonas','Daukantas','Destytojas','Programavimo destytojas','Vilnius','+370 654 09634','265 34 73','simonasdaukantas@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(6,'Linas','Kleiza','Studentas','Antras kursas','Vilnius','+370 654 34553','231 65 73','linaskleiza@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(7,'Robertas','Javtokas','Studentas','Trecias kursas', 'Vilnius','+370 654 13562','213 88 43','robertasjavtokas@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(8,'Oscar','Whilde','Prodekanas','Dekanatas', 'Vilnius','+370 654 46434','216 45 63','oscarwhilde@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(9,'James','Cameron','Studentas','Antras kursas', 'Vilnius','+370 654 99453','216 81 83','jamescameron@gmail.com')</statement>
<statement>INSERT INTO universitetas VALUES(10,'Bred','Pitt','Studentas','Pirmas kursas', 'Vilnius','+370 654 06783','266 66 66','bredpitt@gmail.com')</statement>
</sql>
我收到此错误:no such column: univ.veikla
。我不知道为什么。我想要做的是一个Android应用程序,您可以在其中搜索数据库中的人,单击它并获取存储在数据库中的所有信息。
Logcat:
12-18 19:13:59.583: D/dalvikvm(1014): GC_EXTERNAL_ALLOC freed 54K, 53% free 2561K/5379K, external 1240K/1526K, paused 98ms
12-18 19:14:06.172: D/dalvikvm(1014): GC_EXTERNAL_ALLOC freed 50K, 51% free 2668K/5379K, external 1883K/2025K, paused 32ms
12-18 19:14:06.212: I/Database(1014): sqlite returned: error code = 1, msg = no such column: univ.veikla
12-18 19:14:06.212: D/AndroidRuntime(1014): Shutting down VM
12-18 19:14:06.212: W/dalvikvm(1014): threadid=1: thread exiting with uncaught exception (group=0x40015560)
12-18 19:14:06.222: E/AndroidRuntime(1014): FATAL EXCEPTION: main
12-18 19:14:06.222: E/AndroidRuntime(1014): java.lang.RuntimeException: Unable to start activity ComponentInfo{samples.employeedirectory/samples.employeedirectory.EmployeeDetails}: android.database.sqlite.SQLiteException: no such column: univ.veikla: , while compiling: SELECT univ._id, univ.firstName, univ.lastName, univ.status, univ.veikla, univ.cellPhone, univ.homePhone FROM universitetas univ