Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-2560

syntax error occured when execute double select statement in jdbcT4, but success in sqlci

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1-incubating
    • None
    • client-jdbc-t4
    • None
    • jdbcT4,

    Description

      when i execute follow code

      ####
      @Test
      public void testDoubleSelect() throws IOException, SQLException {
      String ddl = null;
      String tableName = "testDoubleSelect";

      try (Statement stmt = conn.createStatement()) {
      stmt.executeUpdate("cqd traf_blob_as_varchar 'off'");
      ddl = "create table " + schema + ".a" + " (id int not null,name varchar(20))";
      stmt.executeUpdate(ddl);
      stmt.executeUpdate("insert into " + schema + ".a" + " values(1,'table1')");

      ddl = "create table " + schema + ".b" + " (id int not null,name varchar(20))";
      stmt.executeUpdate(ddl);
      stmt.executeUpdate("insert into " + schema + ".b" + " values(1,'table2')");

      rs = stmt.executeQuery("select * from " + schema + ".a" + ";" + " select * from " + schema + ".b");
      while (rs.next())

      { System.out.println(rs.getInt(1) + "::" + rs.getString(2)); }

      } finally

      { cleanTestEnvironment(conn, tableName); }

      }
      ####

      Exception message as follows,
      ####
      A syntax error occurred at or before: select * from a; select * from b;
      ^ (23 characters from start of SQL statement)
      ####

      and i also tried in trafci, failed again, the same error message
      and i execute this double select statement in sqlci, as follows:

      ####
      >>select * from a; select * from b;

      ID NAME
      ----------- --------------------

      1 table1

      — 1 row(s) selected.

      ID NAME
      ----------- --------------------

      1 table2

      — 1 row(s) selected.
      ####

      Attachments

        Activity

          People

            Unassigned Unassigned
            luoyunpeng luoyunpeng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: