Android Sqlite建表语句出错

//数据库建表
public static final String CREATE_USER_TABLE = "create table IF NOT EXISTS"
+ USER_TABLE + "("
+ _ID + " integer primary key autoincrement, "
+ USER_ID + " text, "
+ USER_NAME + " text, "
+ TOKEN + " text, "
+ TOKEN_SECRET + " text, "
+ DESCRIPTION + " text, "
+ USER_HEAD + " BLOB)";

                            出现错误了
                            android.database.sqlite.SQLiteException: near "EXISTSuserinfo": syntax error (code 1): , while compiling: create table IF NOT EXISTSuserinfo(_id integer primary key autoincrement, user_id text, user_name text, token text, token_secret text, description text, user_head BLOB)

1个回答

public static final String CREATE_USER_TABLE = "create table IF NOT EXISTS "
exists后面加个空格

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Sqlite 建表语句
[size=24px][size=18px]今天看到sqlite ,要用sql语句建立一张表,其中有这么个主键的字段[/size][/size]rn rnrn StringBuffer sqlBuffer = new StringBuffer();rn sqlBuffer.append("CREATE TABLE IF NOT EXISTS ");rn sqlBuffer.append(table.tableName);rn sqlBuffer.append(" ( ");rnrn if (id.isAutoIncrement()) rn sqlBuffer.append("\"").append(id.getColumnName()).append("\" ").append("INTEGER PRIMARY KEY AUTOINCREMENT,");rn else rn sqlBuffer.append("\"").append(id.getColumnName()).append("\" ").append(id.getColumnDbType()).append(" PRIMARY KEY,");rn rnrnrn[size=24px]我记得刚学android 的时候做的项目中用到了sqlite,使用的建表语句,是没有主键的[/size]rnrnrn /**rn * 创建表rn */rn @Overridern public void onCreate(SQLiteDatabase db) rn String sql = " create table "+ APPFinal.TABLE_NAME +"("rn + APPFinal.F_MUSICNAME + " nvarchar(50),"rn + APPFinal.F_MUSICARTIST + " nvarchar(10),"rn + APPFinal.F_MUSICPATH + " nvarchar(100),"rn + APPFinal.F_MUSICALBUM + " nvarchar(150))";rn rn db.execSQL(sql);rn rn rn[size=24px]但是能正常使用.这是为什么呢?难道是默认了生成了一个主键????[/size]
android SQL建表语句
这部分的建表语句是在AS中的哪里创建的?求大神解答一下。谢谢![图片说明](https://img-ask.csdn.net/upload/201701/11/1484149176_759334.png)
android sqlite增删改查语句
增加: db.insert(TABLE_NAME, null, values); 删除: db.execSQL("DELETE FROM upload_batch WHERE batch_id = ?", new String[]{batchId}); 查询: Cursor cursor = db.query(TABLE_NAME, null,"upl
android sqlite常用操作语句
android中 sqlite数据库操作中常用的SQL 语句,留下备用,防止出错
Android SQLite增删改查的语句
SQLite是一款轻量级的关系型数据库,它运算速度快,占用资源少 SQLiteDatabase mySql; 删除操作: publicint delete (String table, String whereClause, String[] whereArgs)  String whereClause:零表示删除所有的行,有值时表示通过什么字段来删除,比如通过id删除 String[]
SQLite执行sql语句出错。。。。。。。。。
[code=Java]String sql = "CREATE TABLE pic (_id INTEGRE PRIMARY KEY AUTOINCREMENT NOT NULL , fileName VARCHAR, description VARCHAR)";rnrn db.execSQL(sql);[/code]rnrn用的安卓sdk4.1rn执行到db.execSQL(sql);就报错,显示Source not found,rn这是怎么回事,是不是sql语句写错了。。。
Android SQLite 建表 面向对象编程 完美封装 一劳永逸
Android项目开发过程中经常使用到SQLite数据对数据进行存储,每个app都会有各自的数据DB,以及各种表项。这就意味着每次进行app开发都要编写数据库以及表项的创建代码,而这些建库建表代码量往往不少,但是大多雷同,只是具体数据不一样。仅仅拷贝后,替换都觉得麻烦。 为何不将建库建表封装起来呢?下次建库或者建表时只用配置对应的数据库名,表名以及表属性字段即可。1,建库建表 简单来说S
sqlite内存建表
再下有个疑问,比如sqlite以内存的形式运行:memory:,sqlite内部是怎么新建一张表或者新插入表的一个属性的。内存空间不是已经分配好的吗?我看了sqlite源码中main函数可以一直接受命令行输入,难道是每一条命令之后,sqlite内存都重新构建一次??望高手指教
sqlite建库、建表
仅适用于编程基础薄弱的初学者,(System.Data.SQLite.dll)需要引用
建表语句建表脚本
建表语句建表脚本
sql_server的建表语句,怎么在Access建表中使用出错???
我的一个数字字段在SQL中到Access中写rnCREATE TABLE Temp_999 (rn 文本 Numeric(18,2)rn)rn怎么提示语法有错,该怎么在ACCESS中创建这个带小数位数的数字字段了!!???
Android中的常用SQLite语句
语法     1.创建数据库         sqlite3 DatabaseName.db     2.创建表         create table tablename(col_name type constraint, . . . );         如:create table student(stuNo varchar(20) primary key,----->主键约束
建表语句
CREATE TABLE `tbl_dept`( `id` INT(11) NOT NULL AUTO_INCREMENT, `deptName` VARCHAR(30) DEFAULT NULL, `locAdd` VARCHAR(40) DEFAULT NULL, PRIMARY KEY (`id`) )ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHAR...
android sql语句出错?
出错代码:rndb.execSQL("insert ignore into "+ TABLE+ "(name,position,operation,function,attending,pic) values(?,?,?,?,?,?)",rnnew Object[] item.getName(), item.getPosition(),item.getOperation(), item.getFunction()item.getAttending(), item.getPic() );rn出错原因:rn03-16 16:29:37.720: E/AndroidRuntime(6801): android.database.sqlite.SQLiteException: near "ignore": syntax error (code 1): , while compiling: insert ignore into historyct(name,position,operation,function,attending,pic) values(?,?,?,?,?,?)rn请问一下是我的sql语句出错了吗?
SQLite一条简单的语句怎么会出错呢?
在DOS下输入:rnd:\test> sqlite3 user.dbrnsqlite> .tablesrnaa bb ccrnsqlite>select * from aarnrn出现错误 :rnrn...> 不能退出,用CRTL+C,退出后,出现错误提示rnrn...> InComplete SQL: Select * from aa   居然说这条语句不完整????怎么回事呢?rnrnSQLite.DLL和SQLite3是放在同一目录下的,还有什么没有加上呢?
Sqlite 建表时的外键约束问题
我想建两张表,一张为:rncreate table LinkMan_table(LinkMan_ID int primary key , LinkMan_Name varchar(20))rnrn另一张为:rncreate table Info_tablern(info_ID int primary key,rnLinkMan_ID int ,rnFOREIGN KEY(LinkMan_ID) REFERENCES LinkMan_table(LinkMan_ID)rn)rn语句 SQL server 里没有问题,可以直接使用"foreign key ^^^ references ^^^"为什么sqlite里去执行不了呢???请大家帮帮忙!谢谢了
sqlite 注解获取建表sql
在sqlite 中,利用注解,反射,将jave bean转为建表语句。利用反射将cursor构建bean或者list.
SQLite语句
SQL的使用 1. DDL数据定义语言 2. DML数据操作语言 3. DQL数据查询语言 注意: 1. SQL语句在执行时不区分大小写,为了书写规范一律大写 2. 表格名,字段名不能和关键词同名 3. 每一个SQL语句都以;结尾 DDL语句 创建表格 CREATE TABLE CREATE TABLE 表格名 (字段1 字段1的类型, 字段2 字段2的类型,
android上sqlite数据库打开出错
我用的是中兴的手机,已经ROOT。rndebug时,代码:rn[code=java]rnCursor cursor = SQLiteUtil.getInstance().openSQLQuery(aaa, strSql);rn[/code]rn出错,日志文件显示:rn[code=text]rnFailed to open database '/sdcard/mobile.db'.rnE/SQLiteDatabase(3229): android.database.sqlite.SQLiteException: not an error (code 0): Could not open the database in read/write mode.rnE/SQLiteDatabase(3229): at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)rnE/SQLiteDatabase(3229): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)rnE/SQLiteDatabase(3229): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)rnE/SQLiteDatabase(3229): at android.database.sqlite.SQLiteConnectionPool.openConnectionLockedrn..............rn.........rn.....rn...rn..rn.rn[/code]同样的程序再另外一台HTC的手机上没事rn请问这是怎么回事,如何解决?rn万分感谢~~~
mysql administrator建表出错
设置是这样的[img=https://img-bbs.csdn.net/upload/201305/18/1368839994_261592.png][/img]rnrn执行脚本后出错[img=https://img-bbs.csdn.net/upload/201305/18/1368840036_869611.png][/img]
数据库建表出错
我在建立表时候出现下面问题:rnSQL> (TIMEEND date NOT NULL,rn 2 L1 int(8,5) NOT NULL ,rn 3 L2 int(8,5) NOT NULL ,rn 4 L3 int(8,5) NOT NULL rn 5 );rn(TIMEEND date NOT NULL,rn*rn第 1 行出现错误:rnORA-00928: 缺失 SELECT 关键字 rnrn急切等待中
建表时出错
create table test(rn id int not null;rn pid int,rn fid int,rn primary KEY(id),rn KEY pid(pid),rn KEY fid(fid)rn )rn 提示说在pid(pid)处缺少右括号rnrn我想问是不是oracle不能在建表时这样建立索引,要建表之后再通过create index column_nam on table_name(column) 才可以?
mysql 建表出错问题
我在mysql里面建表:rnrnCREATE TABLE auto_dir (rn dirid int(8) NOT NULL auto_increment,rn userid int(8),rn parentid int(8),rn ifson char(2),rn dirname char(100),rn xuhao int(10),rn mod char(3),rn PRIMARY KEY (dirid),rn KEY xuhao (xuhao)rn);rnrn报错:#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod char(3),rn PRIMARY KEY (dirid),rn KEY xuhao (xuhao)rn)' rnrn请问如何解决?
MySQL建表出错 求解
mysql> use mydata;rnDatabase changedrnmysql> create table emprn(rnempno int primary key,rnename varchar(10),rnjob varchar(10),rnmgr int,rnhiredate datetime,rnsal double,rncomm double,rndeptno intrnforeign int key (deptno) references dept(deptno)rn);rn1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign int key (deptno) references dept(deptno)rn)' at line 11rnmysql>
MySQL建表出错~~
在命令行下 用sql语句 create table student (sid, char(10), sname varchar);总是报错rnERROR 1064 (42000): You have an error in your SQL syntax; check the manual thatrncorresponds to your MySQL server version for the right syntax to use near ')' atrn line 1rnrn如果把varchar改成char的话却能执行,这是什么原因呢rnrn同样的sql语句在access里能执行~~ 希望高手解答下 谢谢
mysql建表出错
mysql建表出错rnrnDROP database IF exists wmSystem;rnrnCREATE database wmSystem;rnrnuse wmSystem;rnrnCREATE TABLE Administrator(rnAdministratorId integer auto_increment not null,rnAdministratorLoginName varchar(50) not null,rnAdministratorPassword varchar(20) not null,rnAdministratorRealName varchar(50),rnprimary key(AdministratorId));rnrnCREATE TABLE Positions(rnPositionId integer auto_increment not null,rnDepartmentId integer not null,rnPositionName varchar(50),rnforeign key(DepartmentId) references Department(DepartmentId),rnprimary key(PositionId));rnrnCREATE TABLE Department(rnDepartmentId integer auto_increment not null,rnDepartmentName varchar(50),rnprimary key(DepartmentId));rnrnCREATE TABLE Employee(rnEmployeeId integer auto_increment not null,rnDepartmentId integer not null,rnPositionId integer not null,rnEmployeeLoginName varchar(50) not null,rnEmployeePassword varchar(20) not null,rnEmployeeRealName varchar(50),rnBaseSalary decimal(20),rnforeign key(DepartmentId) references Department(DepartmentId),rnforeign key(PositionId) references Positions(PositionId),rnprimary key(EmployeeId));rnrn请各位帮我看一下,前面三个表都可以建立,就是employee不能建rn错误提示是:rnERROR 1005 (HY000): Can't create table '.\wmsystem\employee.frm' (errno: 150)rn谢谢大家
在新建表时出错?
我在SYSTEM方案的基础上新建一个表,会出现以下的错误提示:rnORA-06553:PLS-213:STANDARD包不可访问rn递归SQL层1出现错误;rnrn我在连接数据库时,总会出现"访问程序包DBMS_APPLICATION_INFO时出错?rn请问这该怎么解决呀?rn
建表为什么老出错?
With table1 do beginrn active:=false;rn databasename:='DBDEMOS';rn tabletype:=ttparadox;rn tablename:='iuyangxuan'rn createTable;rn endrn调试没有错误可是运行老是出现艺常。!
求救:存储过程建表出错!!
create proc test_create_tablern@i int = 10,@j int = 10rnasrndeclare @m int,@p int, @t char(5),@n char(16)rnset @m=1rnset @p=0rnrnwhile @m<@irnbeginrn while @p<@jrn beginrn set @n='SysSendInfo' + '_0' + convert(varchar,@m) + '_' + convert(varchar,@p)rn print @nrn exec ('create table ' + @n + ' (rn MessageCode varchar(30) not null,rn SystemCode varchar(3) not null,rn ServiceCode varchar(10) not null,rn MobileNum varchar(20) not null,rn MessTopic varchar(50) null,rn SendData varchar(500) not null,rn DataType varchar(1) not null,rn SendWay varchar(1) not null,rn FixedDate datetime null,rn FixedTime varchar(8) null,rn UnitCode varchar(20) null,rn OperCode varchar(30) null,rn SysOperDate datetime not null,rn SysOperTime varchar(8) not null,rn DealOrder numeric null,rn MessContent varchar(1000) null,rn LastSendDate datetime null,rn LastSendTime varchar(8) null,rn SendTimes numeric null,rn MessState varchar(1) not null,rn FilterType varchar(1) null,rn AnswerMatch varchar(1) null,rn ReportDate datetime null,rn ReportTime varchar(8) null,rn Temp1 varchar(20) null,rn Temp2 varchar(20) null,rn Temp3 varchar(30) null,rn Remark varchar(50) null,rn constraint ' + @n + 'primary key (MessageCode)rn )')rn set @p=@p+1rn endrn set @p=0rn set @m = @m + 1rnendrngornrnexec test_create_tablerngo
简单的建表出错,求解
本人刚学sql,按照课本的建立一个关于学生课程的表,和课本上的一样的,可是在sql server 2008 上运行出错,其代码:rncreate table Coursern(rn Cno char(4) primary key,rn Cname char(40),rn Cpno char(4),rn Ccredit smallint,rn foreign key Cpno references Course(Cno)rn);rnrnrn错误为:rn消息 102,级别 15,状态 1,第 7 行rn'Cpno' 附近有语法错误。rnrnrnrn另外请问有没有关于sql server 2008 基础的书籍?我要学习,谢谢大家啦rnrn
mySQL建表出错!
ERROR 1289 (HY000): The 'InnoDB' feature is disabled; you need MySQL built withrn'InnoDB' to have it workingrnrn我用MySQL Administrator时出错,用命令行方式也出错,以上信息,不知如何解决,谢谢!
sqlite相关操作的sqlite语句
之前对在c#中操作sqlite数据库的相关的函数进行了简单的总结,sql语句是其中很重要的一个部分,在本文主要从操作类型分别进行小结 在开始之前,先假设存在一个数据库db,其中有名为realdata的数据表,其中有2列,name 和 salary。 1.  查询语句 Select 列名 from 表名 where 条件子句 group by 分组字句 having 条件字句 order by
【sqlite】sqlite常用SQL语句
1、查询头几条数据 SELECT * FROM table ORDER BY id LIMIT 10; 2、查询最后几条数据 SELECT * FROM table ORDER BY id DESC LIMIT 10; DESC:降序排列
取得建表语句、增删改查语句
取得oracel中所有表的建表语句、增删改查语句
android如何在程序中往sqlite数据库建表?
做期末项目中,我在做一个简单的日程管理软件,设计出来有两张表:rn日程(agenda)和日程类型(agendatype)rn我想怎么在程序中往数据库中建表呢?rn日程表引用类型表,请问该怎么建呢?rnrn请大家指教,非常感谢!rnrn(我自己建了2个DAO类,不知道这样对不对。请大家指教)rn第一个是AgendaDAOrn[code=java]rnpackage com.hj.db.dao;rnrnimport java.util.ArrayList;rnrnimport android.content.ContentValues;rnimport android.content.Context;rnimport android.database.Cursor;rnimport android.database.sqlite.SQLiteDatabase;rnimport android.database.sqlite.SQLiteOpenHelper;rnimport com.hj.db.model.*;rnrnpublic class AgendaDAO extends SQLiteOpenHelper rn private final static String DATABASE_NAME = "_AgendaManagement";rn private final static int DATABASE_VERSION = 1;rn private final static String TABLE_NAME = "_agenda";rn private final static String FIELD_ID = "_id";rn private final static String FIELD_TITLE = "_title";rn private final static String FIELD_CONTENT = "_content";rn private final static String FIELD_AGENDATIME = "_agendatime";rn private final static String FIELD_AGENDADATE = "_agendadate";rn private final static String FIELD_ALARMTIME = "_alarmtime";rn private final static String FIELD_ALARMDATE = "_alarmdate";rn private final static String FIELD_SETALARM = "_setalarm";rn private SQLiteDatabase db;rnrn public AgendaDAO(Context context) rn super(context, DATABASE_NAME, null, DATABASE_VERSION);rn rnrn @Overridern public void onCreate(SQLiteDatabase db) rn String sql = "Create table " + TABLE_NAME + "(" + FIELD_IDrn + " integer primary key autoincrement," + FIELD_TITLE + ","rn + FIELD_CONTENT + "," + FIELD_AGENDATIME + ","rn + FIELD_AGENDADATE + "," + FIELD_ALARMTIME + ","rn + FIELD_ALARMDATE + "," + FIELD_SETALARM + " integer,"rn + "foreign key(_typeid) references _agendatype(_typeid) " + ")";rn db.execSQL(sql);rnrn rnrn @Overridern public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) rn String sql = " DROP TABLE IF EXISTS " + TABLE_NAME;rn db.execSQL(sql);rn onCreate(db);rn db.execSQL(sql);rnrn rnrn public ArrayList getAll() rn SQLiteDatabase db = this.getReadableDatabase();rn Cursor cursor = db.rawQuery("select * from "+TABLE_NAME, null);rn ArrayList agendas = toArrayList(cursor);rn db.close();rn return agendas;rn rnrn public void delete(int id) rn SQLiteDatabase db = this.getWritableDatabase();rn String where = FIELD_ID + "=?";rn String[] whereValue = Integer.toString(id) ;rn db.delete(TABLE_NAME, where, whereValue);rn db.close();rn rnrn public void update(Agenda a) rn SQLiteDatabase db = this.getWritableDatabase();rn String where = FIELD_ID + "=?";rn String[] whereValue = Integer.toString(a.getId()) ;rn ContentValues cv = new ContentValues();rn cv.put(FIELD_TITLE, a.getTitle());rn cv.put(FIELD_CONTENT, a.getContent());rn cv.put(FIELD_AGENDATIME, a.getAgendaTime());rn cv.put(FIELD_AGENDADATE, a.getAgendaDate());rn cv.put(FIELD_ALARMTIME, a.getAlarmTime());rn cv.put(FIELD_ALARMDATE, a.getAlarmDate());rn cv.put(FIELD_SETALARM, a.getSetAlarm());rn cv.put("_typeid", a.getTypeId());rn db.update(TABLE_NAME, cv, where, whereValue);rn db.close();rn rnrn public long insert(Agenda a) rn SQLiteDatabase db = this.getReadableDatabase();rn ContentValues cv = new ContentValues();rn cv.put(FIELD_TITLE, a.getTitle());rn cv.put(FIELD_CONTENT, a.getContent());rn cv.put(FIELD_AGENDATIME, a.getAgendaTime());rn cv.put(FIELD_AGENDADATE, a.getAgendaDate());rn cv.put(FIELD_ALARMTIME, a.getAlarmTime());rn cv.put(FIELD_ALARMDATE, a.getAlarmDate());rn cv.put(FIELD_SETALARM, a.getSetAlarm());rn cv.put("_typeid", a.getTypeId());rn long row = db.insert(TABLE_NAME, null, cv);rn db.close();rn return row;rnrn rnrn private ArrayList toArrayList(Cursor c) rn ArrayList arr = new ArrayList();rnrn while (c.moveToNext()) rn Agenda a = new Agenda();rn a.setId(c.getInt(0));rn a.setTitle(c.getString(1));rn a.setContent(c.getString(2));rn a.setAgendaTime(c.getString(3));rn a.setAgendaDate(c.getString(4));rn a.setAlarmTime(c.getString(5));rn a.setAgendaDate(c.getString(6));rn a.setSetAlarm(c.getInt(7));rn a.setTypeId(c.getInt(8));rn arr.add(a);rn rn return arr;rn rnrnrnrn[/code]rnrn第二个是AgendaTypeDAO:rn[code=java]rnpackage com.hj.db.dao;rnrnimport java.util.ArrayList;rnrnimport com.hj.db.model.Agenda;rnimport com.hj.db.model.AgendaType;rnrnimport android.content.ContentValues;rnimport android.content.Context;rnimport android.database.Cursor;rnimport android.database.sqlite.SQLiteDatabase;rnimport android.database.sqlite.SQLiteOpenHelper;rnrnpublic class AgendaTypeDAO extends SQLiteOpenHelper rn private final static String DATABASE_NAME = "_AgendaManagement";rn private final static int DATABASE_VERSION = 1;rn private final static String TABLE_NAME = "_agendatype";rn private final static String FIELD_TYPEID = "_typeid";rn private final static String FIELD_TYPENAME = "_typename";rn private SQLiteDatabase db;rnrn public AgendaTypeDAO(Context context) rn super(context, DATABASE_NAME, null, DATABASE_VERSION);rn rnrn @Overridern public void onCreate(SQLiteDatabase db) rn String sql = "Create table " + TABLE_NAME + "(" + FIELD_TYPEIDrn + " integer primary key autoincrement," + FIELD_TYPENAME + ")";rn db.execSQL(sql);rnrn rnrn @Overridern public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) rn String sql = " DROP TABLE IF EXISTS " + TABLE_NAME;rn db.execSQL(sql);rn onCreate(db);rnrn rnrn public long insert(AgendaType at) rn SQLiteDatabase db = this.getReadableDatabase();rn ContentValues cv = new ContentValues();rn cv.put(FIELD_TYPENAME, at.getTypeName());rn long row = db.insert(TABLE_NAME, null, cv);rn db.close();rn return row;rnrn rnrn public void delete(int id) rn SQLiteDatabase db = this.getWritableDatabase();rn String where = FIELD_TYPEID + "=?";rn String[] whereValue = Integer.toString(id) ;rn db.delete(TABLE_NAME, where, whereValue);rn db.close();rn rnrn public void update(AgendaType at) rn SQLiteDatabase db = this.getWritableDatabase();rn String where = FIELD_TYPEID + "=?";rn String[] whereValue = Integer.toString(at.getTypeId()) ;rn ContentValues cv = new ContentValues();rn cv.put(FIELD_TYPENAME, at.getTypeName());rn db.update(TABLE_NAME, cv, where, whereValue);rn db.close();rn rnrn public ArrayList getAll() rn SQLiteDatabase db = this.getReadableDatabase();rn Cursor cursor = db.rawQuery("select * from " + TABLE_NAME, null);rn ArrayList at = toArrayList(cursor);rn db.close();rnrn return at;rnrn rnrn public AgendaType getById(int id) rn SQLiteDatabase db = this.getReadableDatabase();rn Cursor cursor = db.rawQuery("select * from " + TABLE_NAME + " where "rn + FIELD_TYPEID + "=" + id + "", null);rn AgendaType at = new AgendaType();rn if (cursor.moveToNext()) rn at.setTypeId(cursor.getInt(0));rn at.setTypeName(cursor.getString(1));rn rn db.close();rn return at;rnrn rnrn private ArrayList toArrayList(Cursor c) rn ArrayList arr = new ArrayList();rnrn while (c.moveToNext()) rn AgendaType a = new AgendaType();rn a.setTypeId(c.getInt(0));rn a.setTypeName(c.getString(1));rn arr.add(a);rn rn return arr;rn rnrnrn[/code]
Android Sqlite数据库常用语句整理
1.创建表的操作create table 表名(字段名 数据类型(限制)…) create table person(_id Integer primary key,name varchar(10),age Integer);2.删除表drop table 表名 drop table person;3.插入数据insert into 表名(字段…) values(字段的值…) insert into
Android原生SQLite常用SQL语句
Android原生SQLite常用SQL语句 创建表 CREATE TABLE student (id integer primary key autoincrement, name varchar(30), age integer) 增 INSERT INTO student(name, age) VALUES("张三", 20) 删 DELETE FROM student WHERE na...
Android SQLite 数据库增删改查dos命令行语句
本篇文章只简单介绍Android SQLite 数据库增删改查的命令行操作,配合数据库截图尽量做到言简意赅通俗易懂。 为了方便大家观看,这里我们通过可视化软件进行命令行操作: 1.增 2.删 删除数据库中的所有数据:delete from 表名 delete from student_score 3.改
Android SQLite SQL语句高级进阶之数据库文件
Android SQLite SQL语句高级进阶之数据库文件,该数据库文件为《SQL必知必会》中提供的SQLite数据库文件,数据库文件中共五张表。
android的sqlite获取当天数据的sql语句
Date KEY_END_AT = new Date(); String where = "strftime('%d.%m.%Y', date(?)) = strftime('%d.%m.%Y', 'now')"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String [] whereArgs = {sdf.format(
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview