有谁帮我看看下面的代码那里有错为什么不能正常的建表那

很好 发布于 2012/07/07 17:40
阅读 103
收藏 0

 //db 1,2创建 online 和 剧集  表
  db.execSQL("create table"+OnlineTable+"("+videoId +" integer primary key autoincrement,"+name+" TEXT,"+type+" text,"+region+" text,"+year+" text,"+actor+" text,"+number+" text,"+television+" text,"+introduction +"text,"+collection+"text ,foreign key ("+number+") references "+JujiTable+"("+number+")))");


  db.execSQL("create table"+JujiTable+"("+videoId+" integer primary key autoincrement,"+webside+" text,"+link+" text,"+number+" text");

  //创建触发器
  db.execSQL("CREATE TRIGGER fk_Movie_deptid before insert on "+JujiTable+" for each row begin" +
    "select case when ((select "+number+" from "+OnlineTable+" where "+number+"=new."+number+")is null) then raise " +
  "(abort,'Foreign Key Violation') end;end");


  //创建视图
  db.execSQL("CREATE VIEW"+ viewEmps+" AS SELECT "+JujiTable+"."+videoId+JujiTable+"."+webside+","+JujiTable+"."+link+","+JujiTable+"."+number+" " +
    ""+OnlineTable+"."+type+","+OnlineTable+"."+number+","+OnlineTable+"."+actor+","+OnlineTable+"."+name+","+OnlineTable+"."+television+","+OnlineTable+"."+year+","+OnlineTable+"."+introduction+","+OnlineTable+"."+collection+","+OnlineTable+"."+region+","+OnlineTable+"."+videoId+"AS _id,"
    +" FROM "+JujiTable+" join "+OnlineTable+" ON "+OnlineTable+"."+number+"="+JujiTable+"."+number+"");

加载中
0
b
blackMcDul
异常贴上来
很好
很好
现在表已经创建出来了。。。但是为什么不能够增加添加语句啊。。。
0
Timor君
Timor君
为什么不是c++写的?
很好
很好
因为我不会c++ 我是学Java的
返回顶部
顶部