Sqlite3语法错误

时间:2012-11-16 04:44:39

标签: sql sqlite

我在sqlite3数据库中插入了一些值,但在这样做时遇到了一些问题。

查询:

INSERT OR REPLACE INTO TECHNICALINFO (PARENTID, PCREATEDBY, PDATECREATED, PDATEMODIFIED, PDESCRIPTION, TECHINFOID, PLAYOUTTYPE, PMEDIAFILE, PMEDIAFILETHUMB, PMEDIAID, PNAME, PPUBLISHDATEEND, PPUBLISHDATESTART, PSTATUS, PTITLE1, PTITLE2, TYREBRANDID, RELATEDCRITERIA, MILEAGEMINVALUE, MILEAGEFREQUENCY, MILEAGETOLERANCE, AGEVEHICLEMINVALUE, AGEVEHICLEFREQUENCY, AGEVEHICLETOLERANCE, ISPUBLISHED, APPROVEDBY, DATEAPPROVED, MEDIUMID, ISAMENDED,FILESIZE,STATUS) VALUES ("0","1","2012-05-02 06:57:27","2012-05-02 06:57:27","<div style='color:#FFF;font-family:Helvetica;'><div style="font-family:Helvetica;"><div style="font-family: Helvetica;"><div style="font-family: Helvetica;"><p><span style="font-size: 18px;"><strong>Brake System</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the Brake System.</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>ABS (anti-lock brake system)</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the ABS (anti-lock brake system).</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>ABS with EDB (electronic brake force distribution)</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the ABS with EDB (electronic brake force distribution).</span></p><p><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>VSC (vehicle stability control)</strong></span></p><p><span style="font-size: 18px;">Features the Component Layout for the VSC (vehicle stability control).</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>Brake Assist System</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the Brake Assist System.</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p></div></div></div></div>","8","(null)","http://46.137.210.235/files/media/full/brake_system.png","http://46.137.210.235/files/media/thumb/brake_system-thumb.png","(null)","2. Brake System","2013-04-23 00:00:00","2012-04-23 00:00:00","2","2. Brake System","","(null)","(null)","(null)","(null)","(null)","(null)","(null)","(null)","YES","1","2012-04-23 10:14:04","439","0","(null)","(null)")

它给了我这个错误:

例外名称:NS_ERROR_FAILURE 异常消息:组件返回失败代码:0x80004005(NS_ERROR_FAILURE)[mozIStorageConnection.createStatement]

我该如何解决这个问题?需要一些指导...

1 个答案:

答案 0 :(得分:2)

"<div style='color:#FFF;font-family:Helvetica;'><div style="font-family:Helvetica;"><div style="font-family: Helvetica;"><div style="font-family: Helvetica;"><p><span style="font-size: 18px;"><strong>Brake System</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the Brake System.</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>ABS (anti-lock brake system)</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the ABS (anti-lock brake system).</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>ABS with EDB (electronic brake force distribution)</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the ABS with EDB (electronic brake force distribution).</span></p><p><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>VSC (vehicle stability control)</strong></span></p><p><span style="font-size: 18px;">Features the Component Layout for the VSC (vehicle stability control).</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p><p><span style="font-size: 18px;"><strong>Brake Assist System</strong></span><br /><span style="font-size: 18px;">Features the Component Layout for the Brake Assist System.</span><br /><span style="font-size: 18px;">Description on individual function of each component.</span></p></div></div></div></div>"

您正尝试在列vlaue中插入包含双引号的内容。双引号被视为分隔符。所以你必须使用两个双引号而不是一个。

例如

"<div style='color:#FFF;font-family:Helvetica;'><div style=""font-family:Helvetica;"">..

等等