I need to check duplicate item in sqlite before inserting the data in table .I need to check whether it already present or not .I have a create a table.
tx.executeSql('CREATE TABLE IF NOT EXISTS CaseTable (id INTEGER PRIMARY KEY AUTOINCREMENT, CaseName TEXT NOT NULL UNIQUE,CaseDate INTEGER ,TextArea TEXT NOT NULL)');
$(document).on('click', '#AddButton', function() {
checkExitingFolderName();
insertData();
}
});
function checkExitingFolderName(){
db.transaction(getallTableCntend, errorCB);
}
function getallTableCntend(tx) {
var str=tx.executeSql('SELECT 1 FROM CaseTable WHERE CaseName ='+$('.caseName_h').val());
alert("str"+str);
}