Same Query but error report

Hi everyone,

Have any ideia about this ?

@wsca
Which version of Metabase? Please post “Diagnostic Info” from Admin > Troubleshooting.
Which version of the Oracle ojdbc-driver?
Check the log for further details - Admin > Troubleshooting > Logs.
And see https://stackoverflow.com/questions/12549029/sql-error-ora-01722-invalid-number

look

jdbc

[31309b9a-abd9-42fd-a8d0-ca53eb673dad] 2020-03-09T07:55:25-03:00 INFO metabase.plugins.classloader Added URL file:/home/ws/metabase/plugins/ojdbc8.jar to classpath

Version

Thanks for using Metabase!
You're on version v0.34.3

Diagnostic Info

{
“browser-info”: {
“language”: “en-US”,
“platform”: “Win32”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.5+10-post-Ubuntu-0ubuntu1.118.04”,
“java.vendor”: “Private Build”,
“java.vendor.url”: “Unknown”,
“java.version”: “11.0.5”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.5+10-post-Ubuntu-0ubuntu1.118.04”,
“os.name”: “Linux”,
“os.version”: “4.4.0-18362-Microsoft”,
“user.language”: “en”,
“user.timezone”: “America/Sao_Paulo”
},
“metabase-info”: {
“databases”: [
“oracle”
],
“hosting-env”: “unknown”,
“application-database”: “mysql”,
“application-database-details”: {
“database”: {
“name”: “MySQL”,
“version”: “5.7.22-log”
},
“jdbc-driver”: {
“name”: “MariaDB Connector/J”,
“version”: “2.5.1”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2020-02-25”,
“tag”: “v0.34.3”,
“branch”: “release-0.34.x”,
“hash”: “1a83edb”
},
“settings”: {
“report-timezone”: null
}
}
}

log

[31309b9a-abd9-42fd-a8d0-ca53eb673dad] 2020-03-09T11:09:30-03:00 DEBUG metabase.middleware.log GET /api/task/info 200 10,9 ms (0 DB calls) Jetty threads: 5/50 (2 idle, 0 queued) (68 total active threads) Queries in flight: 0
[31309b9a-abd9-42fd-a8d0-ca53eb673dad] 2020-03-09T11:14:10-03:00 ERROR metabase.driver.sql-jdbc.execute nil
[31309b9a-abd9-42fd-a8d0-ca53eb673dad] 2020-03-09T11:14:10-03:00 WARN metabase.query-processor.middleware.process-userland-query Falha na consulta {:status :failed,
:class java.sql.SQLSyntaxErrorException,
:error "ORA-01722: número inválido\n",
:stacktrace
("oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509)"
"oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461)"
"oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104)"
"oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550)"
"oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268)"
"oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:655)"
"oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:270)"
"oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:91)"
"oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:807)"
"oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:983)"
"oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)"
"oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3666)"
"oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1426)"
"oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3713)"
"oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1167)"
"com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:431)"
"clojure.java.jdbc$execute_query_with_params.invokeStatic(jdbc.clj:1072)"
"clojure.java.jdbc$execute_query_with_params.invoke(jdbc.clj:1066)"
"clojure.java.jdbc$db_query_with_resultset_STAR_.invokeStatic(jdbc.clj:1081)"
"clojure.java.jdbc$db_query_with_resultset_STAR_.invoke(jdbc.clj:1075)"
"clojure.java.jdbc$query.invokeStatic(jdbc.clj:1164)"
"clojure.java.jdbc$query.invoke(jdbc.clj:1126)"
"--> driver.sql_jdbc.execute$cancelable_run_query.invokeStatic(execute.clj:209)"
"driver.sql_jdbc.execute$cancelable_run_query.invoke(execute.clj:198)"
"driver.sql_jdbc.execute$run_query.invokeStatic(execute.clj:223)"
"driver.sql_jdbc.execute$run_query.invoke(execute.clj:219)"
"driver.sql_jdbc.execute$do_with_auto_commit_disabled.invokeStatic(execute.clj:272)"
"driver.sql_jdbc.execute$do_with_auto_commit_disabled.invoke(execute.clj:260)"
"driver.sql_jdbc.execute$do_in_transaction$fn__69387.invoke(execute.clj:277)"
"driver.sql_jdbc.execute$do_in_transaction.invokeStatic(execute.clj:276)"
"driver.sql_jdbc.execute$do_in_transaction.invoke(execute.clj:275)"
"driver.sql_jdbc.execute$run_query_without_timezone.invokeStatic(execute.clj:300)"
"driver.sql_jdbc.execute$run_query_without_timezone.invoke(execute.clj:299)"
"driver.sql_jdbc.execute$execute_query$fn__69410.invoke(execute.clj:338)"
"driver.sql_jdbc.execute$do_with_try_catch.invokeStatic(execute.clj:252)"
"driver.sql_jdbc.execute$do_with_try_catch.invoke(execute.clj:246)"
"driver.sql_jdbc.execute$execute_query.invokeStatic(execute.clj:332)"
"driver.sql_jdbc.execute$execute_query.invoke(execute.clj:325)"
"driver.sql_jdbc$fn__71316.invokeStatic(sql_jdbc.clj:49)"
"driver.sql_jdbc$fn__71316.invoke(sql_jdbc.clj:47)"
"driver.oracle$eval529$fn__530.invoke(oracle.clj:239)"
"query_processor$fn__46335$execute_query__46340$fn__46341.invoke(query_processor.clj:69)"
"query_processor$fn__46335$execute_query__46340.invoke(query_processor.clj:64)"
"query_processor.middleware.mbql_to_native$mbql__GT_native$fn__37455.invoke(mbql_to_native.clj:40)"
"query_processor.middleware.annotate$result_rows_maps__GT_vectors$fn__40562.invoke(annotate.clj:541)"
"query_processor.middleware.annotate$add_column_info$fn__40468.invoke(annotate.clj:485)"
"query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__41503.invoke(cumulative_aggregations.clj:57)"
"query_processor.middleware.resolve_joins$resolve_joins$fn__43430.invoke(resolve_joins.clj:184)"
"query_processor.middleware.limit$limit$fn__42138.invoke(limit.clj:19)"
"query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__46195.invoke(results_metadata.clj:87)"
"query_processor.middleware.format_rows$format_rows$fn__42126.invoke(format_rows.clj:76)"
"query_processor.middleware.add_dimension_projections$add_remapping$fn__38215.invoke(add_dimension_projections.clj:232)"
"query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__38866.invoke(add_source_metadata.clj:107)"
"query_processor.middleware.resolve_source_table$resolve_source_tables$fn__43480.invoke(resolve_source_table.clj:46)"
"query_processor.middleware.add_row_count_and_status$add_row_count_and_status$fn__38703.invoke(add_row_count_and_status.clj:16)"
"query_processor.middleware.driver_specific$process_query_in_context$fn__41578.invoke(driver_specific.clj:12)"
"query_processor.middleware.resolve_driver$resolve_driver$fn__43094.invoke(resolve_driver.clj:22)"
"query_processor.middleware.store$initialize_store$fn__46220$fn__46221.invoke(store.clj:11)"
"query_processor.store$do_with_store.invokeStatic(store.clj:46)"
"query_processor.store$do_with_store.invoke(store.clj:40)"
"query_processor.middleware.store$initialize_store$fn__46220.invoke(store.clj:10)"
"query_processor.middleware.async$async__GT_sync$fn__37366.invoke(async.clj:23)"
"query_processor.middleware.async_wait$runnable$fn__40619.invoke(async_wait.clj:89)"),
:query
{:type "native",
:native
{:query
"select to_char(dthora, 'dd/mm/YYYY HH24:MI:SS'),\r\n to_number(nvl(b.booking.arrQuotes.arrValues.\"14\", 0)) \r\nfrom booking_cotacoes b\r\nwhere instr(b.booking.arrQuotes.arrValues.\"10\", 'S') = 0 and b.booking.arrQuotes.symbolId.symbol = 'DOL COM'\r\norder by b.dthora desc",
:template-tags {}},
:parameters [],
:async? true,
:middleware {:add-default-userland-constraints? true, :userland-query? true},
:info
{:executed-by 1,
:context :ad-hoc,
:card-id nil,
:nested? false,
:query-hash [-69, -34, 126, 76, -1, -25, 123, -65, 101, 112, 98, 32, -64, -115, 108, -116, -101, -46, -2, 96, -124, -53, -94, -51, -40, 27, 53, 98, -109, 123, 24, 84]},
:constraints {:max-results 10000, :max-results-bare-rows 2000}},
:cause {:class oracle.jdbc.OracleDatabaseException, :error "ORA-01722: número inválido\n"}}

[31309b9a-abd9-42fd-a8d0-ca53eb673dad] 2020-03-09T11:14:10-03:00 DEBUG metabase.middleware.log POST /api/dataset 202 [ASYNC: completed] 282,6 ms (10 DB calls) Jetty threads: 4/50 (2 idle, 0 queued) (68 total active threads) Queries in flight: 0

@wsca Which specific version of ojdbc8.jar did you download? https://www.metabase.com/docs/latest/administration-guide/databases/oracle.html
Look at the stackoverflow post - it’s something to do with type conversion. Whatever the other query tool on the right is, it’s probably using a different driver, which might be helping somewhere.
I don’t know why it’s working in the other tool. You probably need to look at the debug log on your Oracle database to understand what’s going on.