【发布时间】:2021-10-29 19:16:21
【问题描述】:
我似乎无法弄清楚这个语法错误是什么,我已经为 mac 和图像字段尝试了 TEXT 和 BLOB,但似乎没有任何效果。请帮忙!
customQuery("CREATE TABLE Profile ("
"mac TEXT,"
"image TEXT,"
"name TEXT,"
"age INT,"
"nationality TEXT,"
"profession TEXT,"
"about TEXT"
")");
onPressed: () {
profile.add(Profile(
mac: _platformVersion,
image: imagePath,
name: nameController.text,
age: ageController.text,
nationality: nationalityController.text,
profession: professionController.text,
about: aboutController.text));
DBProvider.db.customQuery("INSERT Into Profile (mac,image,name,age,nationality,profession,about)"
" VALUES (${profile[0].mac},${profile[0].image},"
"${profile[0].name},${profile[0].age},${profile[0].nationality},"
"${profile[0].profession},${profile[0].about});");
},
&这是错误
E/SQLiteLog( 4520): (1) near ".0": syntax error in "INSERT Into Profile (mac,image,name,age,nationality,profession,about) VALUES (0.0.0.0.0.0,/data/user/0/com.test.fltestar/cache/scaled_image_picker3315305739073272987.jpg,test,35,test
E/flutter ( 4520): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: DatabaseException(near ".0": syntax error (code 1 SQLITE_ERROR): , while compiling: INSERT Into Profile (mac,image,name,age,nationality,profession,about) VALUES (0.0.0.0.0.0,/data/user/0/com.test.test/cache/scaled_image_picker3315305739073272987.jpg,test,35,test,test,test);) sql 'INSERT Into Profile (mac,image,name,age,nationality,profession,about) VALUES (0.0.0.0.0.0,/data/user/0/com.test.test/cache/scaled_image_picker3315305739073272987.jpg,test,35,test,test,test);' args []
【问题讨论】:
标签: android ios flutter sqlite