Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

SQLite inserting float value

$
0
0

Hello everyone!

I have a problem with inserting some values into table(SQLite library). I have 3 columns, 1. is ID, second is number/value and third is just a string. Problem is that because I have float as value SQLite thinks I am sending 4 values in because float has a comma in it.

My code:

query = "INSERT INTO" +String.format(" %s VALUES(NULL, %d, '%s');", TableName, value, randomText);
    db.query(query);

What Processing is saying:

INSERT INTO VrednostiEKG VALUES(NULL, 0,23, 'Stiski?'); java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (table VrednostiEKG has 3 columns but 4 values were supplied)

Anyone knows of a solution? I could make another column and separate value float into 2 different columns but that could make things messy at the end.


Viewing all articles
Browse latest Browse all 2896

Trending Articles