luoyunpeng created TRAFODION-2560:
-------------------------------------
Summary: syntax error occured when execute double select statement
in jdbcT4, but success insqlci
Key: TRAFODION-2560
URL: https://issues.apache.org/jira/browse/TRAFODION-2560
Project: Apache Trafodion
Issue Type: Bug
Components: client-jdbc-t4
Affects Versions: 2.1-incubating
Environment: jdbcT4,
Reporter: luoyunpeng
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.
####
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)