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

Last updated on MARCH 08, 2017

Applies to:

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


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

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


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
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


Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms