On 19 Jan 2011, at 9:10am, Gigin Jose wrote:
> I am working on ARM9 based s3c2440 embedded platform on linux OS. The
> database I use is SQLITE over QT application. The "insert into" query is
> failing once I try to insert values into a database. The database resides on
> a NAND flash with yaffs2 formated filesystem.
I don't have time to explore all the peculiarities of a new file system, so
you're going to have to narrow it down a little. Please try exactly the same
procedure, including deleting the data file, on a conventional hard disk using
a conventional file system, and tell us if it fails there.
> The following is the query which I execute:
> QString stat = QString("insert into user20 values('%0', '%1','%2'
> )").arg(id).arg(name).arg(address);
> k = query.exec(stat);
> if(k == false) qDebug("K is false for record ,%s
> \n",id.toAscii().data());
> After continuous read/write the query is failing.
Your problem could be anything up to running out of space on the drive.
SQLite returns a result status, not just true/false. Please tell us the result
code:
http://www.sqlite.org/c3ref/c_abort.html
If possible please also obtain the text form of the error message:
http://www.sqlite.org/c3ref/errcode.html
since this often gives even more precise information about the problem.
> Once I restart my target (s3c2440), the query is again executed fine. Before
> the query is executed, I delete the database file, if it exist, so that
> ideally the record insertion can happen.
You delete the file while you have a handle to it open in your target ? That
will upset anything trying to access the file. Delete the file only when your
application does not have a connection to it.
Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users