Hi, sorry for asking so much but its hard to find doc on the sqlite library. I have another problem,
I want to make a query based on the name of the street, but i have to pass it from a variable, like using "+mystreetString+"
But it doesn't work. It does work however if my variable is an int and not a String, i guess because String is a class and int is a primitive / datatype? If i just type the name of the street in the query command it works fine too, but it doesnt help me much. Here's the code, i've commented out the lines that work in case u want to test:
Thanks for the help, by the way, queries are really slow... is this normal? my database is just 27 mb, i actually transfered all my files to a database cuz i thought it would process data much faster but it seems to be even slower.
- import de.bezier.data.sql.*;
- SQLite db;
- void setup()
- {
- size( 400, 400);
- db = new SQLite( this, "data/sevilla_price_map.db" );
- }
- void draw(){
- String street="Calle Regina";
- int daytoday=day()-2;// u see, my database is not up to date...
- int input_price=2700;
- if ( db.connect() && frameCount==20) {
- db.query("SELECT * FROM variable_data WHERE \"idname\"="+street+" AND \"day\"="+daytoday+" AND \"month\"="+month()+" AND \"year\"="+year()+"");
- //db.query("SELECT * FROM variable_data WHERE \"idname\"=\"Calle Regina\" AND \"day\"="+daytoday+" AND \"month\"="+month()+" AND \"year\"="+year()+"");
- //db.query("SELECT * FROM variable_data WHERE \"stPrice\"="+input_price+" AND \"day\"="+daytoday+" AND \"month\"="+month()+" AND \"year\"="+year()+"");
- while (db.next ()) {
- String name=db.getString("idname");
- int price=db.getInt("stPrice");
- println(price);
- println(name);
- }
- }
- println(frameCount);
- }
1