Home > Net >  Why that SQLite command does not work in Unity?
Why that SQLite command does not work in Unity?

Time:03-31

If this command is run in Sqlite, it works fine. However, if you try from Unity, an error occurs.

'''

IDbCommand command = dbConnection.CreateCommand();
        command.CommandText = @"
                            UPDATE AnotherTable SET V1 = (SELECT Intelligence from Table1 
                                where AnotherTable.id in (
                            select AnotherTable.id from AnotherTable 
                                inner join Table1 on AnotherTable.id = Table1.Id
                                WHERE AnotherTable.V2 = 0 and AnotherTable.V1 = "") and 
                                Table1.Id = AnotherTable.Id) where id in(
                            select AnotherTable.id from AnotherTable 
                                inner join Table1 on AnotherTable.id = Table1.Id
                                WHERE AnotherTable.V2 = 0 and AnotherTable.V1 = "");
                            ";
command.ExecuteNonQuery();
command.Dispose();
base.SetCubicsGreenField();

'''

error text:

'''

SQL logic error
near ";": syntax error;  at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, System.UInt32 timeoutMS, System.String& strRemain) [0x003d4] in .. 

'''

CodePudding user response:

Instead of empty quotes, use:

length(let) = 0
  • Related