【问题标题】:Converting MySQL database dump into SQLite - INSERT syntax将 MySQL 数据库转储转换为 SQLite - INSERT 语法
【发布时间】:2012-09-09 14:28:38
【问题描述】:

我正在尝试使用以下命令将我的数据库转储调整为 SQLite 格式: cat db.sql | sqlite3 sqlite.db

我收到以下错误: Error: near line 82: near ",": syntax error ,其中第 82 行代表: INSERT INTO files (file_id,file_name) VALUES(以下格式的插入数据(31, 'file_name.pdf'),在后面几行)。

根据this tutorial,INSERT 的 SQLite 语法是正确的。我做错了什么?

【问题讨论】:

  • 第 82 行:INSERT INTO files (file_id,file_name) VALUES,第 83 行:(31, 'file_name.pdf'),
  • 你还能在第 83 行之前和之后发布行吗?我需要看看你的记录是如何格式化的。
  • 在这个表('files')中,所有值的格式都相同,最后一行要插入的值是:(55, 'filexxx.pdf');

标签: mysql sqlite


【解决方案1】:

在一个 INSERT 命令中有多个记录不是标准 SQL。

如果您使用此语法,则至少需要 SQLite 3.7.11。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-14
    • 2019-02-14
    • 2014-08-24
    • 1970-01-01
    • 2012-09-08
    • 2022-10-13
    相关资源
    最近更新 更多