Error in SQLite tables

Put your problem here if it does not fit any of the other categories.

Error in SQLite tables

Postby nithin.warier » Fri Feb 29, 2008 3:53 pm

Syntax: [ Download ] [ Hide ]
Using sql Syntax Highlighting
  1. myDatabase.execSQL("CREATE TABLE IF NOT EXISTS Testing"
  2.  
  3.            +" (age INT(2), sex VARCHAR, height INT(3);");
  4.  
  5. AND inserting TO TABLE USING
  6.  
  7. myDatabase.execSQL("INSERT INTO Testing (age,sex,height) VALUES ("+getAge+",'"+getSex+"',"+getHeight+");");
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


but it is showing run time error.. the error is Application error, table Testing has no cloumn named age

Waiting for your valuable comments

Thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

First thought

Postby cadlg » Fri Feb 29, 2008 4:20 pm

Hello nithin.warier,

My first thought was:

Maybe the table already exists, but with another structure from your first tests, and since you are using CREATE IF NOT EXISTS, the table is never created with the structure you want now...

You could try removing the "IF NOT EXIST" and run the application once, to see what happens, or run the emulator with -wipe-data (that I assume will clean all user data, so be careful).


It's just an idea.

Regards,

cadlg
cadlg
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Wed Feb 20, 2008 12:33 am
Location: Guatemala

Postby nithin.warier » Fri Feb 29, 2008 4:23 pm

thanks
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 18 guests