mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -93,7 +93,7 @@ public final class PreparedStatementHolder {
|
||||
}
|
||||
|
||||
public boolean isInUse() {
|
||||
return inUseCount <= 0;
|
||||
return inUseCount > 0;
|
||||
}
|
||||
|
||||
public void incrementInUseCount() {
|
||||
|
||||
@@ -103,18 +103,6 @@ public class SQLUtils {
|
||||
}
|
||||
|
||||
public static String format(String sql, String dbType) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
return formatOracle(sql);
|
||||
}
|
||||
|
||||
if (JdbcUtils.MYSQL.equals(dbType)) {
|
||||
return formatMySql(sql);
|
||||
}
|
||||
|
||||
if (JdbcUtils.POSTGRESQL.equals(dbType)) {
|
||||
return formatPGSql(sql);
|
||||
}
|
||||
|
||||
SQLStatementParser parser = SQLParserUtils.createSQLStatementParser(sql, dbType);
|
||||
List<SQLStatement> statementList = parser.parseStatementList();
|
||||
|
||||
|
||||
+47
-38
@@ -300,15 +300,8 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
for (;;) {
|
||||
MySqlCreateUserStatement.UserSpecification userSpec = new MySqlCreateUserStatement.UserSpecification();
|
||||
|
||||
SQLCharExpr expr = (SQLCharExpr) exprParser.expr();
|
||||
String user = expr.toString();
|
||||
if (lexer.token() == Token.VARIANT) {
|
||||
lexer.nextToken();
|
||||
SQLCharExpr expr2 = (SQLCharExpr) exprParser.expr();
|
||||
user += '@';
|
||||
user += expr2.toString();
|
||||
}
|
||||
userSpec.setUser(new SQLIdentifierExpr(user));
|
||||
SQLExpr expr = exprParser.primary();
|
||||
userSpec.setUser(expr);
|
||||
|
||||
if (lexer.token() == Token.IDENTIFIED) {
|
||||
lexer.nextToken();
|
||||
@@ -478,7 +471,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
|
||||
public MySqlDescribeStatement parseDescribe() throws ParserException {
|
||||
if (identifierEquals("DESC") || identifierEquals("DESCRIBE")) {
|
||||
if (lexer.token() == Token.DESC || identifierEquals("DESCRIBE")) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new ParserException("expect DESC, actual " + lexer.token());
|
||||
@@ -1626,7 +1619,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
SQLName tableName = this.exprParser.name();
|
||||
insertStatement.setTableName(tableName);
|
||||
|
||||
if (lexer.token() == Token.IDENTIFIER) {
|
||||
if (lexer.token() == Token.IDENTIFIER && !identifierEquals("VALUE")) {
|
||||
insertStatement.setAlias(lexer.stringVal());
|
||||
lexer.nextToken();
|
||||
}
|
||||
@@ -1639,7 +1632,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.VALUES)) {
|
||||
if (lexer.token() == Token.VALUES || identifierEquals("VALUE")) {
|
||||
lexer.nextToken();
|
||||
|
||||
for (;;) {
|
||||
@@ -1656,6 +1649,29 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (lexer.token() == Token.SET) {
|
||||
lexer.nextToken();
|
||||
|
||||
SQLInsertStatement.ValuesClause values = new SQLInsertStatement.ValuesClause();
|
||||
insertStatement.getValuesList().add(values);
|
||||
|
||||
for (;;) {
|
||||
SQLName name = this.exprParser.name();
|
||||
insertStatement.getColumns().add(name);
|
||||
if (lexer.token() == Token.EQ) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
accept(Token.COLONEQ);
|
||||
}
|
||||
values.getValues().add(this.exprParser.expr());
|
||||
|
||||
if (lexer.token() == Token.COMMA) {
|
||||
lexer.nextToken();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (lexer.token() == (Token.SELECT)) {
|
||||
SQLQueryExpr queryExpr = (SQLQueryExpr) this.exprParser.expr();
|
||||
@@ -1679,15 +1695,8 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
|
||||
MySqlDropUser stmt = new MySqlDropUser();
|
||||
for (;;) {
|
||||
SQLCharExpr expr = (SQLCharExpr) this.exprParser.expr();
|
||||
String user = expr.toString();
|
||||
if (lexer.token() == Token.VARIANT) {
|
||||
lexer.nextToken();
|
||||
SQLCharExpr expr2 = (SQLCharExpr) this.exprParser.expr();
|
||||
user += '@';
|
||||
user += expr2.toString();
|
||||
}
|
||||
stmt.getUsers().add(new SQLIdentifierExpr(user));
|
||||
SQLExpr expr = this.exprParser.expr();
|
||||
stmt.getUsers().add(expr);
|
||||
if (lexer.token() == Token.COMMA) {
|
||||
lexer.nextToken();
|
||||
continue;
|
||||
@@ -1727,7 +1736,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (identifierEquals("RESTRICT")) {
|
||||
stmt.setOption("RESTRICT");
|
||||
lexer.nextToken();
|
||||
@@ -1735,25 +1744,25 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setOption("CASCADE");
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
|
||||
protected SQLDropViewStatement parseDropView(boolean acceptDrop) {
|
||||
if (acceptDrop) {
|
||||
accept(Token.DROP);
|
||||
}
|
||||
|
||||
|
||||
MySqlDropViewStatement stmt = new MySqlDropViewStatement();
|
||||
|
||||
|
||||
accept(Token.VIEW);
|
||||
|
||||
|
||||
if (lexer.token() == Token.IF) {
|
||||
lexer.nextToken();
|
||||
accept(Token.EXISTS);
|
||||
stmt.setIfExists(true);
|
||||
}
|
||||
|
||||
|
||||
for (;;) {
|
||||
SQLName name = this.exprParser.name();
|
||||
stmt.addTableSource(name);
|
||||
@@ -1763,7 +1772,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (identifierEquals("RESTRICT")) {
|
||||
stmt.setOption("RESTRICT");
|
||||
lexer.nextToken();
|
||||
@@ -1771,7 +1780,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setOption("CASCADE");
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
@@ -2009,30 +2018,30 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
}
|
||||
|
||||
|
||||
public SQLStatement parseRename() {
|
||||
MySqlRenameTableStatement stmt = new MySqlRenameTableStatement();
|
||||
|
||||
|
||||
acceptIdentifier("RENAME");
|
||||
|
||||
|
||||
accept(Token.TABLE);
|
||||
|
||||
|
||||
for (;;) {
|
||||
MySqlRenameTableStatement.Item item = new MySqlRenameTableStatement.Item();
|
||||
item.setName(this.exprParser.name());
|
||||
acceptIdentifier("TO");
|
||||
item.setTo(this.exprParser.name());
|
||||
|
||||
|
||||
stmt.getItems().add(item);
|
||||
|
||||
|
||||
if (lexer.token() == Token.COMMA) {
|
||||
lexer.nextToken();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return stmt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -767,8 +767,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
if (x.getColumns().size() > 0) {
|
||||
incrementIndent();
|
||||
println();
|
||||
print("(");
|
||||
print(" (");
|
||||
for (int i = 0, size = x.getColumns().size(); i < size; ++i) {
|
||||
if (i != 0) {
|
||||
if (i % 5 == 0) {
|
||||
@@ -785,8 +784,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
if (x.getValuesList().size() != 0) {
|
||||
println();
|
||||
print("VALUES");
|
||||
println();
|
||||
print("VALUES ");
|
||||
for (int i = 0, size = x.getValuesList().size(); i < size; ++i) {
|
||||
if (i != 0) {
|
||||
print(", ");
|
||||
|
||||
@@ -381,7 +381,7 @@ public class OracleExprParser extends SQLExprParser {
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
identifierEquals("TO");
|
||||
acceptIdentifier("TO");
|
||||
if (identifierEquals("SECOND")) {
|
||||
lexer.nextToken();
|
||||
interval.setToType(OracleIntervalType.SECOND);
|
||||
@@ -462,7 +462,7 @@ public class OracleExprParser extends SQLExprParser {
|
||||
}
|
||||
|
||||
public OracleDateExpr parseDate() {
|
||||
identifierEquals("DATE");
|
||||
acceptIdentifier("DATE");
|
||||
|
||||
OracleDateExpr timestamp = new OracleDateExpr();
|
||||
|
||||
@@ -829,4 +829,16 @@ public class OracleExprParser extends SQLExprParser {
|
||||
|
||||
return column;
|
||||
}
|
||||
|
||||
public SQLExpr exprRest(SQLExpr expr) throws ParserException {
|
||||
expr = super.exprRest(expr);
|
||||
|
||||
if (lexer.token() == Token.COLONEQ) {
|
||||
lexer.nextToken();
|
||||
SQLExpr right = expr();
|
||||
expr = new SQLBinaryOpExpr(expr, SQLBinaryOperator.Assignment, right);
|
||||
}
|
||||
|
||||
return expr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1138,7 +1138,7 @@ public class SQLExprParser extends SQLParser {
|
||||
if (lexer.token() == token) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new SQLParseException("syntax error, expect " + token + ", actual " + lexer.token());
|
||||
throw new SQLParseException("syntax error, expect " + token + ", actual " + lexer.token() + " " + lexer.stringVal());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MappingVisitorTest extends TestCase {
|
||||
}
|
||||
|
||||
public void test_insert() throws Exception {
|
||||
Assert.assertEquals("INSERT INTO device\n\t(serviceTag, ip)\nVALUES\n(?, ?)",
|
||||
Assert.assertEquals("INSERT INTO device (serviceTag, ip)\nVALUES (?, ?)",
|
||||
engine.explainToInsertSQL("(编号, IP地址) VALUES (?, ?)"));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PSCacheTest extends TestCase {
|
||||
DruidPooledPreparedStatement pooledStmt1 = (DruidPooledPreparedStatement) stmt1;
|
||||
|
||||
Assert.assertEquals(1, pooledStmt1.getPreparedStatementHolder().getInUseCount());
|
||||
Assert.assertNotSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
Assert.assertSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
|
||||
PreparedStatement stmt2 = conn.prepareStatement(sql);
|
||||
DruidPooledPreparedStatement pooledStmt2 = (DruidPooledPreparedStatement) stmt2;
|
||||
@@ -66,7 +66,7 @@ public class PSCacheTest extends TestCase {
|
||||
DruidPooledPreparedStatement pooledStmt1 = (DruidPooledPreparedStatement) stmt1;
|
||||
|
||||
Assert.assertEquals(1, pooledStmt1.getPreparedStatementHolder().getInUseCount());
|
||||
Assert.assertNotSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
Assert.assertSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
|
||||
PreparedStatement stmt2 = conn.prepareStatement(sql);
|
||||
DruidPooledPreparedStatement pooledStmt2 = (DruidPooledPreparedStatement) stmt2;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PSCacheTest1 extends TestCase {
|
||||
DruidPooledPreparedStatement pooledStmt1 = (DruidPooledPreparedStatement) stmt1;
|
||||
|
||||
Assert.assertEquals(1, pooledStmt1.getPreparedStatementHolder().getInUseCount());
|
||||
Assert.assertNotSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
Assert.assertSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
|
||||
PreparedStatement stmt2 = conn.prepareStatement(sql);
|
||||
DruidPooledPreparedStatement pooledStmt2 = (DruidPooledPreparedStatement) stmt2;
|
||||
@@ -64,7 +64,7 @@ public class PSCacheTest1 extends TestCase {
|
||||
DruidPooledPreparedStatement pooledStmt1 = (DruidPooledPreparedStatement) stmt1;
|
||||
|
||||
Assert.assertEquals(1, pooledStmt1.getPreparedStatementHolder().getInUseCount());
|
||||
Assert.assertNotSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
Assert.assertSame(pooledStmt1.getPreparedStatementHolder(), pooledStmt0.getPreparedStatementHolder()); // same
|
||||
|
||||
PreparedStatement stmt2 = conn.prepareStatement(sql);
|
||||
DruidPooledPreparedStatement pooledStmt2 = (DruidPooledPreparedStatement) stmt2;
|
||||
|
||||
@@ -63,7 +63,7 @@ public class TestSharePreparedStatements extends TestCase {
|
||||
conn.setAutoCommit(false);
|
||||
|
||||
PreparedStatement stmt = conn.prepareStatement(sql);
|
||||
Assert.assertEquals(true, mockStmt != stmt.unwrap(MockPreparedStatement.class));
|
||||
Assert.assertSame(mockStmt, stmt.unwrap(MockPreparedStatement.class));
|
||||
ResultSet rs = stmt.executeQuery();
|
||||
rs.next();
|
||||
rs.close();
|
||||
@@ -77,7 +77,7 @@ public class TestSharePreparedStatements extends TestCase {
|
||||
conn.setAutoCommit(false);
|
||||
|
||||
PreparedStatement stmt = conn.prepareStatement(sql);
|
||||
Assert.assertEquals(true, mockStmt != stmt.unwrap(MockPreparedStatement.class));
|
||||
Assert.assertSame(mockStmt, stmt.unwrap(MockPreparedStatement.class));
|
||||
ResultSet rs = stmt.executeQuery();
|
||||
rs.next();
|
||||
rs.close();
|
||||
|
||||
@@ -227,7 +227,7 @@ public class ConnectionTest4 extends TestCase {
|
||||
{
|
||||
PreparedStatement stmt = conn.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY,
|
||||
ResultSet.CONCUR_READ_ONLY);
|
||||
Assert.assertEquals(raw, stmt.unwrap(MockPreparedStatement.class));
|
||||
Assert.assertSame(raw, stmt.unwrap(MockPreparedStatement.class));
|
||||
stmt.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.alibaba.druid.bvt.sql.cobar;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
public class DMLInsertParserTest extends TestCase {
|
||||
public void testInsert_0() throws Exception {
|
||||
String sql = "insErt HIGH_PRIORITY intO test.t1 seT t1.id1=?, id2 := '123'";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("INSERT HIGH_PRIORITY INTO test.t1 (t1.id1, id2)\n" + //
|
||||
"VALUES (?, '123')", output);
|
||||
}
|
||||
|
||||
public void testInsert_1() throws Exception {
|
||||
String sql = "insErt IGNORE test.t1 seT t1.id1:=? oN dupLicatE key UPDATE ex.col1=?, col2=12";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("INSERT IGNORE INTO test.t1 (t1.id1)\nVALUES (?) " + //
|
||||
"ON DUPLICATE KEY UPDATE ex.col1 = ?, col2 = 12", output);
|
||||
}
|
||||
|
||||
public void testInsert_2() throws Exception {
|
||||
String sql = "insErt t1 value (123,?) oN dupLicatE key UPDATE ex.col1=?";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("INSERT INTO t1\nVALUES (123, ?) ON DUPLICATE KEY UPDATE ex.col1 = ?", output);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class EncryptionAndCompressionFunctionsTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT INTO t\nVALUES\n(1, AES_ENCRYPT('text', 'password'));", text);
|
||||
Assert.assertEquals("INSERT INTO t\nVALUES (1, AES_ENCRYPT('text', 'password'));", text);
|
||||
}
|
||||
|
||||
public void test_1() throws Exception {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class InsertSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT INTO tbl_name\nVALUES\n();", text);
|
||||
Assert.assertEquals("INSERT INTO tbl_name\nVALUES ();", text);
|
||||
}
|
||||
|
||||
public void test_1() throws Exception {
|
||||
@@ -46,7 +46,7 @@ public class InsertSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT INTO tbl_name\n\t(col1, col2)\nVALUES\n(15, col1 * 2);", text);
|
||||
Assert.assertEquals("INSERT INTO tbl_name (col1, col2)\nVALUES (15, col1 * 2);", text);
|
||||
}
|
||||
|
||||
public void test_2() throws Exception {
|
||||
@@ -57,7 +57,7 @@ public class InsertSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT INTO tbl_name\n\t(col1, col2)\nVALUES\n(col2 * 2, 15);", text);
|
||||
Assert.assertEquals("INSERT INTO tbl_name (col1, col2)\nVALUES (col2 * 2, 15);", text);
|
||||
}
|
||||
|
||||
public void test_3() throws Exception {
|
||||
@@ -68,7 +68,7 @@ public class InsertSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT INTO tbl_name\n\t(a, b, c)\nVALUES\n(1, 2, 3), (4, 5, 6), (7, 8, 9);", text);
|
||||
Assert.assertEquals("INSERT INTO tbl_name (a, b, c)\nVALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);", text);
|
||||
}
|
||||
|
||||
public void test_4() throws Exception {
|
||||
@@ -79,7 +79,7 @@ public class InsertSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT INTO tbl_name\n\t(a, b, c)\nVALUES\n(1, 2, 3, 4, 5\n\t, 6, 7, 8, 9);", text);
|
||||
Assert.assertEquals("INSERT INTO tbl_name (a, b, c)\nVALUES (1, 2, 3, 4, 5\n\t, 6, 7, 8, 9);", text);
|
||||
}
|
||||
|
||||
public void test_5() throws Exception {
|
||||
@@ -90,7 +90,7 @@ public class InsertSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT LOW_PRIORITY DELAYED HIGH_PRIORITY IGNORE INTO tbl_name\n\t(a, b, c)\nVALUES\n(1, 2, 3);",
|
||||
Assert.assertEquals("INSERT LOW_PRIORITY DELAYED HIGH_PRIORITY IGNORE INTO tbl_name (a, b, c)\nVALUES (1, 2, 3);",
|
||||
text);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class InsertSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("INSERT INTO tbl_name\n\t(a, b, c)\nVALUES\n(1, 2, 3) ON DUPLICATE KEY UPDATE c = c + 1;",
|
||||
Assert.assertEquals("INSERT INTO tbl_name (a, b, c)\nVALUES (1, 2, 3) ON DUPLICATE KEY UPDATE c = c + 1;",
|
||||
text);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SHOW_COLUMNS_Syntax_Test extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("SHOW COLUMNS FROM mytable FROM mydb;", text);
|
||||
Assert.assertEquals("SHOW COLUMNS FROM mydb.mytable;", text);
|
||||
}
|
||||
|
||||
public void test_2() throws Exception {
|
||||
|
||||
@@ -9,12 +9,10 @@ insert into accontexchangeinfo a
|
||||
|
||||
|
||||
---------------------------
|
||||
INSERT INTO accontexchangeinfo
|
||||
(a.id, a.sourceid, a.batchno, a.applicant, a.out_uid
|
||||
INSERT INTO accontexchangeinfo (a.id, a.sourceid, a.batchno, a.applicant, a.out_uid
|
||||
, a.in_uid, a.moneytype, a.amount, a.remark, a.gmt_create
|
||||
, a.gmt_modified)
|
||||
VALUES
|
||||
(SEQ_ACCONTEXCHANGEINFO.nextval, ?, ?, ?, ?
|
||||
VALUES (SEQ_ACCONTEXCHANGEINFO.nextval, ?, ?, ?, ?
|
||||
, ?, ?, ?, ?, SYSDATE
|
||||
, SYSDATE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user