Problems when I try to see databases in SQLite

Posted by Sabau Andreea on Stack Overflow See other posts from Stack Overflow or by Sabau Andreea
Published on 2012-03-31T17:24:32Z Indexed on 2012/03/31 17:29 UTC
Read the original article Hit count: 285

Filed under:
|

I created in code a database and two tables:

static final String dbName="graficeCirculatie";


static final String ruteTable="Rute";
static final String colRuteId="RutaID";
static final String colRuta="Ruta";

static final String statiaTable="Statia";
static final String colStatiaID="StatiaID";
static final String colIdRuta="IdRuta";
static final String colStatia="Statia";


public DatabaseHelper(Context context) {
      super(context, dbName, null,33); 
}


public void onCreate(SQLiteDatabase db) {
      // TODO Auto-generated method stub

      db.execSQL("CREATE TABLE " + statiaTable + " (" + colStatiaID + " INTEGER PRIMARY KEY , " +
        colIdRuta + " INTEGER, " +  colStatia + " TEXT)");

      db.execSQL("CREATE TABLE " + ruteTable + "(" + colRuteId + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
              colRuta + " TEXT);");



      InsertDepts(db);  
}

 void InsertDepts(SQLiteDatabase db)
 {
    ContentValues cv = new ContentValues();

    cv.put(colRuteId, 1);
    cv.put(colRuta, "Expres8");
    db.insert(ruteTable, colRuteId, cv);

    cv.put(colRuteId, 2);
    cv.put(colRuta, "Expres2");
    db.insert(ruteTable, colRuteId, cv);

    cv.put(colRuteId, 3);
    cv.put(colRuta, "Expres3");
    db.insert(ruteTable, colRuteId, cv);

 }

Now I want to see tables inputs from command line. I try in this way:

C:\Program Files\Android\android-sdk\tools> sqlite3 SQLite version 3.7.4 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> sqlite3 graficeCirculatie ...> select * from ruteTable;

And I got an error: Error: near "squlite3": syntax error.

Can someone help me?

© Stack Overflow or respective owner

Related posts about database

Related posts about sqlite