JavaScript Javascript Database Transaction Error could not prepare statement has no column javascript database transaction,javascript database transaction example,javascript db.transaction,

I'm currently having a problem where when I try to insert data I'm receiving an error that the table column does not exist but I have defined it. I've currently isolated the problem and decided to insert data manually. Once I get past my alert('inserting data manually'), a popup shows with Error was could not prepare statement (1 table expenses has no column named expenseDate) (Code 5).

I have taken these SQL statements and tested them in a SQLite3 database, and everything checked out fine. The interesting thing is that when I go to my developer console->resources tab, I do not see my tables.

Any help would be appreciated.

My js is below:

var shortName='TravelExpenseReporting';
var version='0.1';
var displayName='TravelExpenseReporting';
var maxSize = 65536;

db = openDatabase(shortName,version,displayName,maxSize);
try {
 db.transaction(
    function(transaction) {
        transaction.executeSql(
            'CREATE TABLE IF NOT EXISTS expenses ' +
            '(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' +
            'type TEXT NOT NULL, ' + 'amount DOUBLE NOT NULL, ' +
            'vendor TEXT NOT NULL, ' + 'expensedate DATE NOT NULL);' 
        );
    }
 ); // END transaction()
} catch(e) {
alert('error: ' + e);
return;
}

alert('inserting data manually');

try {
 db.transaction(
    function(transaction) {
        transaction.executeSql(
            'INSERT INTO expenses (type,amount,vendor,expensedate) VALUES (?,?,?,?);',
            ['expenseType',100,'vendor','01/01/2004'],
            null,
            errorHandler
        );
    }
 ); // END transaction()
} catch(e) {
alert('error: ' + e);
return;

}

Answer:1

I'm trying to get forever-monitor working in node-webkit. I've used it in node express applications in the past without any problems, but can't seem to make it work in this case. I have an index....

I'm trying to get forever-monitor working in node-webkit. I've used it in node express applications in the past without any problems, but can't seem to make it work in this case. I have an index....

  1. using forever-monitor

I am currently working on importing png or svg files onto a canvas using the fabric.js library and an input file button. The code below works only if the image is in the root folder. I know that I don'...

I am currently working on importing png or svg files onto a canvas using the fabric.js library and an input file button. The code below works only if the image is in the root folder. I know that I don'...

Using the node.js console, I get the following unexpected results: > 2 + "3" "23" > 2 * "3" 6 Why does the first example favor string concatenation and integer multiplication in the second ...

Using the node.js console, I get the following unexpected results: > 2 + "3" "23" > 2 * "3" 6 Why does the first example favor string concatenation and integer multiplication in the second ...

  1. unexpected results in javascript

I know this has been discussed in other threads, but I've very new to coding websites in general, and when I try to use the solutions others have come up with, they just don't seem to work. And I ...

I know this has been discussed in other threads, but I've very new to coding websites in general, and when I try to use the solutions others have come up with, they just don't seem to work. And I ...

  1. twitter bootstrap close modal