0

我正在向我的 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]

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

4

1 回答 1

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;"">..

等等

于 2012-11-16T04:52:50.240 回答