2 Replies Latest reply on Jun 11, 2009 3:55 PM by ahmed.malik

    IN clause errors for SQLStatement

    Peter_Mason
      Can anyone explain how a statement like "SELECT * FROM foo WHERE id IN (n1,n2...)" can be presented within an air.SQLStatement object so that "[SQLErrorEvent type="error" bubbles=false cancelable=false error=SQLError: 'Error #3132: Data type mismatch.', details:'could not convert text value to numeric value.', operation:'execute', detailID:'2300']" is not returned?
        • 1. Re: IN clause errors for SQLStatement
          flexstone Level 1
          Try using SQL.parameters which seems to help avoid typing issues. See the SQLite documentation for AIR.
          • 2. Re: IN clause errors for SQLStatement
            ahmed.malik

            Hi

             

            I am facing exactly same error, but on an update statement.

             

            SQLError: 'Error #3132: Data type mismatch.', details:'could not convert text value to numeric value.', operation:'execute', detailID:'2300'

             

            here is my code:

             

            stmt = new SQLStatement();

            stmt.text = "UPDATE PracticeTable SET UserAnswer=:userAnswer, TimeTaken=:timeTaken WHERE Primarykey=:primaryKey";

             

             

            stmt.parameters[":userAnswer"] = "C";

            stmt.parameters[":timeTaken"] = "10";

            stmt.parameters[":primaryKey"] = 141;

             

             

            stmt.sqlConnection = MySQLConnection.Instance.Connection;

            stmt.execute();

             

            following is my table

             

            CREATE TABLE "PracticeTable" ("PrimaryKey" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL  , "CategoryName" VARCHAR NOT NULL , "QuestionHTMLName" VARCHAR NOT NULL , "AnswerHTMLName" VARCHAR, "AnswerCorrectOption" VARCHAR, "NoOfOptions" INTEGER, "UserAnswer" VARCHAR, "TimeTaken" VARCHAR, "StatusOfAnswer" VARCHAR, "BookMark" VARCHAR, "RCJoin" VARCHAR DEFAULT 0, "SyncFlage" INTEGER NOT NULL  DEFAULT 0)

             

            I really can't figure out what's wrong ...

             

            Best regards,

            Ahmed.