java.sql.SQLException: Non supported SQL92 token at position: 1

Seems like this is very common error in pl/sql programming. I know there are many last minute frustrations just because of this error which is no where related to any logic. This seems to be some format error in the programming language itself.

The error message is:

java.sql.SQLException: Non supported SQL92 token at position: 1
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.OracleSql.handleToken(OracleSql.java:1165)
at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:1064)
at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:984)
at oracle.jdbc.driver.OracleSql.getSql(OracleSql.java:312)
at oracle.jdbc.driver.OracleSql.getSqlBytes(OracleSql.java:557)

The Solution:

Error scenario code snippet is

 stmt = (OracleCallableStatement)conn.prepareCall("{:1 = callfnd_webfile.get_url("+typeStr+",:2,:3,:4,:5,:6,:7,:8,:9) }");

Should be changed to correct syntax as mentioned below.

 stmt = (OracleCallableStatement)conn.prepareCall("begin :1 :=fnd_webfile.get_url("+typeStr+",:2,:3,:4,:5,:6,:7,:8,:9); end;");

Some of other solutions i came across though not always work are:
remove TABS and newlines from the SQL in the procedure call.

2 thoughts on “java.sql.SQLException: Non supported SQL92 token at position: 1

  1. Thanks ! It Worked

Leave a Reply

Your email address will not be published. Required fields are marked *