当前位置:网站首页>sqlite 查看表结构 android.database.sqlite.SQLiteException: table splitTable has no column named
sqlite 查看表结构 android.database.sqlite.SQLiteException: table splitTable has no column named
2022-07-31 05:15:00 【为今天而努力】
Sqlite 插入数据数据时提示没有该列:
android.database.sqlite.SQLiteException: table splitTable has no column named isLast (code 1):
此时可以查看该表的创建结构,然后调整列名称,重新调用插入的方法。
Cursor cursor = db.rawQuery("select * from sqlite_master where type= 'table' and name='" + tableName + "'", null);
/**
* 查询到结果对应的列名与位置
* 0 = "type"
* 1 = "name"
* 2 = "tbl_name"
* 3 = "rootpage"
* 4 = "sql"
**/
if (cursor.moveToNext()){
String sql = cursor.getString(cursor.getColumnIndex("sql"));
Log.d(TAG, "showCreateTable: sql " + sql);
}
边栏推荐
猜你喜欢

CMOS管原理,及其在推挽电路中的应用

对js的数组的理解

MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案

Digital twins will be an important way to enter the "metaverse"

feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r

Gradle sync failed: Uninitialized object exists on backward branch 142

动态规划(一)| 斐波那契数列和归递

On the side of Ali, tell me what are the application scenarios of message middleware you know?

对于输出点是时间戳的渗透测试方法(以Oracle数据库为例)

win11中利用IIS10搭建asp网站
随机推荐
【Elastic-Job源码分析】——作业监听器
powershell统计文件夹大小
sqlmap注入教程 常用指令
js中的对象与函数的理解
Fragmented NFT (Fractional NFT)
纯shell实现文本替换
数字取证autopsy工具用法
configure:error no SDL library found
CMOS管原理,及其在推挽电路中的应用
Linux中mysql密码修改方法(亲测可用)
"limit" query in Oracle database
小白学爬虫——爬虫入门
Three-party login using wallet Metamask based on web3.0
带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?
js中的this指向与原型对象
How MySQL - depots table?A look at will understand
File operations in C language (1)
MySQL compressed package installation, fool teaching
About integrating superset into your own project
【Elastic-Job】分布式调度任务概览篇