My Oracle Support Banner

"begin ? := {call HELLOWORLD(?)}; end;" Syntax Fails With ORA-06550 And PLS-00103 When using JDBC 11.2.0.2; It Works With JDBC 11.0.1.7 (Doc ID 1322478.1)

Last updated on FEBRUARY 03, 2019

Applies to:

JDBC - Version: 11.2.0.2 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms


Using JDBC 11.2.0.2 (ojdbc6.jar) and JDK 1.6, a java program using the statements below works as expected:



CallableStatement cstmt = conn.prepareCall("begin ? := HELLOWORLD(?); end;");

or

CallableStatement cstmt = conn.prepareCall("{? = call HELLOWORLD (?)}");


However, with the following syntax for the same statement, it fails:


CallableStatement cstmt = conn.prepareCall("begin ? := {call HELLOWORLD(?)}; end;");



java TestJDBCcall
JDBC driver version is 11.2.0.2.0
java.sql.SQLException: ORA-06550: line 1, column 14:
PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:

( - + case mod new not null <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternatively-quot
ORA-06550: line 1, column 41:
PLS-00103: Encountered the symbol ";" when expecting one of the following:

end not pragma final instantiable order overriding static
member constructor map

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:204)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1007)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4714)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at TestJDBCcall.main(TestJDBCcall.java:45)



All the above statements work with no issues when using JDBC 11.1.0.7.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
  Symptoms
  Cause
  Solution
  References

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.