need help from some gurus here, I have a database which I have moved to the documents directory. For one procedure, I check if a table ‘PASS’ exists, if it does I delete & recreate it (just quicker). then I start reading data from another table ‘EN’, at the end of the calculation I attempt to insert values (ints, chars from the ‘EN’ table, floats) from both the ‘EN’ table and my own calcs
the procedure loops a couple hundred times and passes through the sqlite3_exec statement without errors.
But when I go to check the table it’s empty (used sqlite manager addon for firefox)
the actual code is below, if anyone could spot the problem I’d be in great debt
thanks
sqlite3 *dbCon;
sqlite3_open([self.dblocation UTF8String], &dbCon); // open
NSString *insert=[NSString stringWithFormat:@"INSERT INTO PASS VALUES('%d','%s','%s','%f','%f','%f','%f','%f','%f','%f','%f','%f','%f','%f','%f','%f','%f,%f');",
sqlite3_column_int(selectstmt, 0), //id
sqlite3_column_text(selectstmt, 1), // type
sqlite3_column_text(selectstmt, 2), // designation
sqlite3_column_double(selectstmt, 4), // weight
sqlite3_column_double(selectstmt, 5), //area
d, // depth
sqlite3_column_double(selectstmt, 28), // ix
sqlite3_column_double(selectstmt, 30),
cb,
mmax,
smax,
stress,
fb,
shear,
0.4*1000*yield,
def,
span/240.,
span/360.
];
sqlite3_exec(dbCon, [insert UTF8String],NULL,NULL,nil); // borrada
sqlite3_close(dbCon);
NEVERMIIND,
at the end of the NSString I have ‘%f,%f’ ~~> ‘%f’,’%f’ fixes it
thanks!