Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.4.15
-
None
-
None
Description
import groovy.sql.Sql import oracle.jdbc.driver.OracleConnection def sql = Sql.newInstance("jdbc:oracle:thin:@dev6418:1521:l101", "allcus", "allcus", "oracle.jdbc.OracleDriver") def sqlParams = [:] def row = sql.firstRow('select count(*) icount from all_tables', Arrays.asList(sqlParams)) println row.icount
Mai 28, 2018 4:08:36 PM groovy.sql.Sql$AbstractQueryCommand execute WARNUNG: Failed to execute: select count(*) icount from all_tables because: Ungültiger Spaltentyp Mai 28, 2018 4:08:36 PM groovy.sql.Sql$AbstractQueryCommand execute WARNUNG: Failed to execute: select count(*) icount from all_tables because: Ungültiger Spaltentyp Exception thrown java.sql.SQLException: Ungültiger Spaltentyp at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:10495) at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:9974) at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:10799) at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:10776) at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:241) at ConsoleScript8.run(ConsoleScript8:8)
def sqlParams = [a:1]
also provides an error but following works
def sqlParams = [a:1, b:1]
def row = sql.firstRow('select count(*) icount from all_tables where 1=:a', Arrays.asList(sqlParams))