Saturday, 24 August 2013

sqlite query in oncreate decimal and other value types

sqlite query in oncreate decimal and other value types

as i am making an app that has to connect to an database on a server in
the future i want to make now a database on my android phone that has the
same columns and column names.
in my oncreate i made following
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + databasetabel + "(" +
recordnummer + " BLOB NOT NULL, " +
bezoekrapportnummer + " PRIMARY KEY BLOB AUTO INCREMENT, " +
bezoekrapportdatum + " DATETIME NOT NULL, " +
herstellingsoort + " VARCHAR(1) NOT NULL, " +
totaleduur + " VARCHAR(4) NOT NULL, " +
servicenummer + " BLOB NOT NULL, " +
ONBEKEND + " VARCHAR(2) NOT NULL, " +
klantnaam + " VARCHAR(100) NOT NULL, " +
adres + " VARCHAR(100) NOT NULL, " +
machinenummer + " BLOB NOT NULL, " +
omschrijving + " TEXT NULL, " +
duur + " VARCHAR(4) NOT NULL, " +
postcode + " VARCHAR(8) NOT NULL, " +
gemeente + " VARCHAR(30) NOT NULL, " +
merk + " VARCHAR(20) NOT NULL, " +
model + " VARCHAR(20) NOT NULL, " +
serienummer + " VARCHAR(20) NOT NULL, " +
opmerkingen + " TEXT NULL, " +
werkgereed + " VARCHAR(1) NOT NULL, " +
extratijd + " VARCHAR(4) NOT NULL, " +
urenstand + " BLOB NOT NULL, " +
gecontroleerdbureel + " VARCHAR(1) NOT NULL, " +
onderhoudsfiche + " VARCHAR(30) NOT NULL, " +
uitsplitsen + " VARCHAR(1) NOT NULL, " +
opmerkingbureel + " TEXT NULL, " +
ONBEKEND2 + " BLOB NOT NULL, " +
orderverwerkdatum + " DATETIME NOT NULL, " +
ordernummer + " BLOB NOT NULL, " +
basisservicenummer + " BLOB NOT NULL, " +
verzonden + " VARCHAR(1) NOT NULL );"
);
except for the BLOB statements i have everything declared as in my
database on my server (BLOB were all of the type DECIMAL(5,0) or simular)
anyway, BLOB or DECIMAL or ... all of it is giving following line in my
logcat:
08-24 11:59:04.578: E/SQLiteLog(5918): (1) near "BLOB": syntax error
except for this line there are no more red log lines
as this is the first time i have to work with sqlite i think my query is
wrong how to fix it so i have a table that allows me to put in the same
data as on my server
i found out already on the net that DECIMAL doesn't exists in sqlite that
is why i changed them to BLOB with no effect
thanks in advance

No comments:

Post a Comment