SQLite Delphi增加了不正确的异常(SQLite Delphi thowing up incorrect exception)

编程入门 行业动态 更新时间:2024-10-26 05:24:26
SQLite Delphi增加了不正确的异常(SQLite Delphi thowing up incorrect exception)

Project CompetitionServer.exe引发异常类ESQLiteException,并显示消息'执行SQL时出错。 错误[1]:SQL错误或缺少数据库。 “INSERT INTO MatchesTable(MatchesID,RoundID,AkaFirstName,AoFirstName)VALUES(1,2,p,o)”:no such column:p'。 进程停止。 使用“步骤”或“运行”继续。

是的,p不是一列,而是我试图插入的数据。 我该如何解决这个问题?

Project CompetitionServer.exe raised exception class ESQLiteException with message 'Error executing SQL. Error [1]: SQL error or missing database. "INSERT INTO MatchesTable(MatchesID,RoundID,AkaFirstName,AoFirstName)VALUES(1,2,p,o)": no such column: p'. Process stopped. Use Step or Run to continue.

Yes, p is NOT a column, it is the data I am trying to insert. How can I fix this problem?

最满意答案

在SQL中,作为数据的字符串常量必须用引号引起来。 否则,字符串被解释为关键字,表名或列名,这就是发生在这里的情况。 用'p'代替普通的p。

In SQL, string constants that are data must be enclosed in quotes. Otherwise the string is interpreted as a keyword, table name, or column name, which is what's happening here. Use 'p' instead of plain p.

更多推荐

本文发布于:2023-08-04 16:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1417891.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不正确   增加了   异常   Delphi   SQLite

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!