0 Replies Latest reply on Nov 7, 2009 8:09 AM by oceanfeeling

    Create multiple tables in one statement

    oceanfeeling Level 1

      Hi there,


      I was trying to create an AIR database with 2 tables.

      I created an SQLStatement using the following code


      var cmd:SQLStatement = new SQLStatement();

      cmd.sqlConnection = conn;

      cmd.text = "CREATE TABLE IF NOT EXISTS Table1 (id INTEGER, name TEXT); " +

                     "CREATE TABLE IF NOT EXISTS Table2 (id INTEGER, name TEXT);"



      The code executes with no errors but after inspecting the database, using a SQLSchemaResult I realized that only the first table had been created.


      I thought that by using the ';' character I could execute multiple SQL statements using one SQLStatement, like you can do in SQL.


      Was my thought correct? Or this is a limitation?