To expand on ThePhantomUpvoter's comment - which answers the question - but mostly to remove this from the unanswered list:
Change:
x.executeSql('CREATE TABLE IF NOT EXISTS '+CASENAME'+(id INTEGER PRIMARY KEY AUTOINCREMENT, DocumentName TEXT NOT NULL,DocumentDate INTEGER ,DocumentNotes TEXT NOT NULL)');
To:
x.executeSql('CREATE TABLE IF NOT EXISTS '+CASENAME+'(id INTEGER PRIMARY KEY AUTOINCREMENT, DocumentName TEXT NOT NULL,DocumentDate INTEGER ,DocumentNotes TEXT NOT NULL)');