sqlite parameterized query not working in javascript interface of imacros for firefox

0

Dear Stackoverflow users,

I use iMacros for firefox for various tasks and recently I started using sqlite as database backend.

As long as I supplied values along with query, it was working. I want to change it to parameterized. With sql and parameter, it is giving following error: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [mozIStorageStatement.execute]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: resource://gre/modules/RemoteAddonsParent.jsm line 780 > eval :: iimSqlite.prototype.exec :: line 89" data: no], line 89 (Error code: -991)

My code is here:

var sql1,param1;
var db=new iimSqlite("test_v1.sqlite");
//alert("file ok");
db.exec('create table if not exists test ([ID] text primary key,[col 1] text,[col 2] number,[col 3] text);');
//alert("create table ok");
sql1='insert or replace into test ([ID],[col 1],[col 3],[col 2]) values(:id, :col1, :col3, :col2);';
param1=[{name:"id",value:"255"},{name:"col1",value:"col1 text"},{name:"col2",value:458752},{name:"col3",value:"col3 text"},]
alert(sql1);
db.exec(sql1,param1);
alert("insert ok");
db.close();

Kindly help me to get this working.

Thanks.


I was using a library taken from imacros for firefox forum. parameter binding inthat library was not proper and thats why it was not working for my. I edited the code in library and itis not working.

Here is the link to forum post having more detail on this issue.

http://forum.imacros.net/viewtopic.php?f=11&t=27442&p=73579#p73579

javascript
sqlite
firefox
imacros
asked on Stack Overflow Apr 17, 2017 by Vivekanandhan • edited Jul 31, 2019 by Martijn Pieters

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0