Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Carson Huang
    @kot09
    Okay, never, error was on my side... I had two ID columns.
    never mind*
    I feel like an idiot haha. Spent a good hour testing things out, trying to figure what was wrong.
    Christopher J. Brody
    @brodybits
    No problem, glad you fixed it.
    Carson Huang
    @kot09
    What are the data types available? I'm trying to add a float data type.
    Christopher J. Brody
    @brodybits
    NULL, INTEGER, REAL, TEXT, BLOB
    You may want to read the section about sqlite type affinity as well at: https://www.sqlite.org/datatype3.html#affinity
    Sigfrido Rodríguez Santos
    @identy
    :)
    laoyao
    @laoyao
    execute a sql in a transation
    can only run one time
    Why
    there is no response on second time
    @brodybits Can you help me
    laoyao
    @laoyao
    db.transaction(function(tx) {
    tx.executeSql("select distinct contractor_name from construction_range;", [], function(tx, res) {
    alert(JSON.stringify(res));
    }, function(e) {
    alert("ERROR: " + e.message);
    });
    });
    Christopher J. Brody
    @brodybits
    Hi. Unfortunately I do not really understanding your problem.
    Christopher J. Brody
    @brodybits
    That looks very strange. It would help to know how you create and populated the table and also which platform you see this on
    I can look at this issue sometime next week.
    laoyao
    @laoyao
    @brodybits hi
    are you on line?
    Christopher J. Brody
    @brodybits
    One moment
    What is going on?
    Adrienrx
    @adrienrx
    Can i create this function in my sqlite database ?
    Christopher J. Brody
    @brodybits
    You could add user-defined functions to the Objective-C code for iOS, https://github.com/liteglue/Android-sqlite-native-driver for Android, or the embedded SQLite3-WinRT library for Windows/Windows Phone 8.1. To get user defined functions working in Javascript would be extremely difficult (if possible at all) since it is an asynchronous interface.
    laoyao
    @laoyao
    Is there some people on line
    Why ios version transaction only run one time?when i
    call on second time,there is no reponse
    Anyone meet this satuation?
    Christopher J. Brody
    @brodybits
    Do you mean that you can only run one transaction, or do you try to try to run the same transaction multiple times (which is not allowed)
    ?
    laoyao
    @laoyao
    Same transaction run on click event
    First click return the result
    second click has no response
    Christopher J. Brody
    @brodybits
    Do you mean that the click event handler has code that executes a transaction with a callback, and after the second click the transaction callback function is not called?
    laoyao
    @laoyao
    Yeah
    function query(){
            db.transaction(function(tx) {
                tx.executeSql("select distinct contractor_name from construction_range;", [], function(tx,res) {
                    alert(JSON.stringify(res));
                });
            });
         }
    my function
    is there any problem?
    Christopher J. Brody
    @brodybits
    I do not recommend using JSON.stringify(res), since res is not really a JSON object.
    res has the following members: rows, rowsAffected, and sometimes insertId. The rows member has a length member and an item function.
    laoyao
    @laoyao
    ok
    but the second click has no response,any soluation?
    can u give me some advise?
    Christopher J. Brody
    @brodybits
    Try changing the alert statement to something like: alert("res.rows.length: " + res.rows.length + (res.rows.length == 0) ? "" : " item(0): " + JSON.stringify(res.rows.item(0)));
    laoyao
    @laoyao
    i change alert(“run”), but second click not called
    is this a bug?
    when i change this line:

    SQLitePlugin.prototype.transaction = function(fn, error, success) {
    if (!this.openDBs[this.dbname]) {
    error(newSQLError('database not open'));
    return;
    }
    // To Fix
    // this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, true, false));
    this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, false, false));

    };

    in sqliteplugin.js, then the second is called