Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Sqlite integration query issue

$
0
0

Hey everyone,

I am trying to use the SQLite cordova plugin on my Ionic 2 app.

My code looks like this :

    this.platform.ready().then(() => {
        let options = { name : "my_db" };
        this.storage = new Storage(SqlStorage, options);
        this.storage.query("CREATE TABLE IF NOT EXISTS categories (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(50))", []).then((data) => {
            console.log("New table : " + JSON.stringify(data));
        }, (error) => {
            console.log(error);
        });
    });

And I'm getting an error I don't really understand (at least in this case) : number of '?'s in statement string does not match argument count.

I installed cordova-sqlite-plugin, even though I'm pretty sure it's only used on a real phone/emulator, so I don't think this should be causing any problem.

What did I do wrong ?

Thanks,

kinkaz


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>