i wouldn believe it if i hadnt seen it
my statements are the following (it is fortran code, and the function
executeStatement is c++ where i call sqlite3_exec)
statement = "create table parameters(name varchar(128), zkern integer, eanz integer,
nmax integer, k integer, m integer, bfeld double, energy double, intpoints
integer);"//char(0)
call executeStatement(trim(statement))
statement = "insert into parameters values('"//trim(adjustl(name))//"', "//trim(adjustl(czkern))//", "//trim(adjustl(cnofel))//",
"//trim(adjustl(cmb))//", "//trim(adjustl(ck))//", "//trim(adjustl(cnmax))//", "//trim(adjustl(cbfeld))//",
"//trim(adjustl(cenergy))//", "//trim(adjustl(cip))//");"//char(0)
call executeStatement(trim(statement))
statement = "create table quantumnumbers(name varchar(128), m integer, nu
integer);"//char(0)
call executeStatement(trim(statement))
statement = 'insert into quantumnumbers values("'//trim(adjustl(name))//'",
'//trim(cm)//', '//trim(cnu)// ");"//char(0)
call executeStatement(trim(statement))
statement = "create table coefficients(name varchar(128), xj double, tvec double,
pvec double);"//char(0)
call executeStatement(trim(statement))
statement = 'insert into coefficients values("'//trim(adjustl(name))//'",
'//trim(cxj)//', '//trim(ctvec)//', '//trim(cpvec)//");"//char(0)
call executeStatement(trim(statement))
in between these statements i only cast variables into characters. is it
possible that this mistake is coming from the nfs? i start different processes
which have nothing to do with one another. could the nfs locking fail, so that
one process writes into a table another process wants to write?
Thorsten Kersting<Thorsten.Kersting at itp1.uni-stuttgart.de
<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>> wrote:
/ i have one database, with three tables. My programm (c++) tries to
/>/ create the tables every time it writes into them, but that shouldnt do
/>/ any harm.
/>/ the problem is now, that i find data from one table written into another
/>/ table.
/
With all due respect, I find it difficult to believe. If you execute a
statement like
INSERT INTO TableX VALUES(...);
this statement may succeed and insert a row into TableX, or it may fail and not
insert any rows. Under no circumstances can it insert a row into some other
table, say TableY.
Perhaps you are building the statement on the fly, choosing the table name
dynamically. Or perhaps you are renaming tables with ALTER TABLE statement,
after some rows have already been inserted. Either way, look for problems in
your code. If you still have difficulty, post here a reasonably small
self-contained sample that reproduces the issue.
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users