Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-17068: Invalid arguments in call when looking up quoted identifiers via DatabaseMetaData::getIndexInfo

Lukas EderSep 24 2024

I'm using com.oracle.database.jdbc:ojdbc11:23.5.0.24.07

Create a table like this:

create table "_t" (i int primary key, j int);
create index "_i" on "_t" (j);

Now query JDBC's DatabaseMetaData as follows:

connection.getMetaData().getColumns(null, "TEST", "_t", null);
connection.getMetaData().getPrimaryKeys(null, "TEST", "_t");
connection.getMetaData().getImportedKeys(null, "TEST", "_t");
connection.getMetaData().getExportedKeys(null, "TEST", "_t");
connection.getMetaData().getTablePrivileges(null, "TEST", "_t");
connection.getMetaData().getColumnPrivileges(null, "TEST", "_t", "%");
connection.getMetaData().getIndexInfo(null, "TEST", "_t", false, true);

All the methods work as expected except the getIndexInfo one, which throws:

java.sql.SQLException: ORA-17068: Invalid arguments in call 
https://docs.oracle.com/error-help/db/ora-17068/ 
at oracle.jdbc.OracleDatabaseMetaData.getIndexInfo(OracleDatabaseMetaData.java:3889) 
at org.jooq.testscripts.JDBC.main(JDBC.java:54)

The workaround is to wrap the name in double quotes:

connection.getMetaData().getIndexInfo(null, "TEST", "\"_t\"", false, true);

But this doesn't seem necessary in my opinion. It's not necessary for any of the other queries, and the error message doesn't help understanding why this would be needed either.

Comments

Add EVENT_10842=15

You can also set this as an environment variable with the same name & value.

Sheeraz Majeed May 10 2024 — edited on May 10 2024

Hi, Thanks for reply.

But still no trace or log files to check used oci functions

Works for me.

cjones@cjones-mac:~$ rm -rf $HOME/instantclient/log/diag/clients && mkdir -p $HOME/instantclient/log/diag/clients
cjones@cjones-mac:~$ export EVENT_10842=15
cjones@cjones-mac:~$ sqlplus cj/cj@localhost/orclpdb1

...

SQL> select * from dual;

D
-
X

SQL> exit

And then a file like /Users/cjones/instantclient/log/diag/clients/user_cjones/host_nnnnnn_nn/trace/ora_nnn_nnnnn.trc will contain lines like:

# 2024-06-06 07:26:54.520 # Thread ID 8547126272 # Entry - OCIServerAttach(srvhp = 0x128030068, errhp = 0x13580a410, dblink_hash = H:0x9bf0f8e9ee161fdf, mode = OCI_DEFAULT(000000000), dblink = localhost/orclpdb1, dblink_len = 18 );
1 - 3

Post Details

Added on Sep 24 2024
0 comments
247 views