1

I am trying to get the fields of a table in an Arctic database. For that I've been successful at creating a jdbcConnection object which is of class "JDBCConnection", but once I write the following code to get the fields of the AR_LOT table (dbListFields comes from DBI package),

dbListFields(jdbcConnection, name = Id(schema = "ARCTIC", table = "AR_LOT"))

I get the following error message.

Error in dbSendQuery(conn, paste("SELECT * FROM ", dbQuoteIdentifier(conn, : Unable to retrieve JDBC result set JDBC ERROR: ORA-00933: SQL command not properly ended Statement: SELECT * FROM "ARCTIC"."AR_LOT" LIMIT 0

I also tried with RJDBC's function dbGetFields, but I'm also running into an error.

Error in .jcall(md, "Ljava/sql/ResultSet;", "getColumns", .jnull("java/lang/String"), : method getColumns with signature (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet; not found

The weird thing is that dbReadTable from DBI package works just fine.

Can anyone please help me understand these error messages a little more clearly? Thanks in advance

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Diego
  • 392
  • 3
  • 16
  • What happens when you execute that query directly: `dbGetQuery(jdbcConnection, 'select * from "ARCTIC"."AR_LOT" LIMIT 0')`? – langtang May 03 '22 at 23:38
  • Please show the working `dbReadTable` line. Are you using `Id()`? What does `dbListTables` and `dbListObjects` show? – Parfait May 04 '22 at 00:11
  • @langtang I get Error in dbSendQuery(conn, statement, ...) : Unable to retrieve JDBC result set JDBC ERROR: ORA-00933: SQL command not properly ended Statement: select * from "ARCTIC"."AR_LOT" LIMIT 0 – Diego May 04 '22 at 12:49
  • dbReadTable does output the right table, and this is how I'm constructing that `dbReadTable(jdbcConnection, name = Id(schema = "ARCTIC", table = "AR_LOT"))`. And as for dbListTables I'm just passing the connection and I'm getting back some random tables that I guess live somewhere in the various schemas – Diego May 04 '22 at 12:55
  • this might be a dumb suggestion, but what if you add `;` to the end of the statement (i.e. `dbGetQuery(jdbcConnection, 'select * from "ARCTIC"."AR_LOT" LIMIT 0;')? – langtang May 04 '22 at 12:55
  • @langtang pretty much the same error (except ; at the end too) – Diego May 04 '22 at 13:17
  • hmm, sorry, I'm not sure.. I assume it can't return LIMIT 1, either? – langtang May 04 '22 at 13:27
  • @langtang yes it doesn't seem to return limit 1 either, I just don't get this JDBC ERROR: ORA-00933 – Diego May 04 '22 at 13:45

0 Answers0