Mock tests, Interview questions, Tutorials and Tech news
 
 
Home > Programming / tutorials > Output parameter not allowed as argument list prevents use of RPC.

Output parameter not allowed as argument list prevents use of RPC.

While calling a stored procedure from my java class; I was getting the following  error-

java.sql.SQLException: “Output parameter not allowed as argument list prevents use of RPC.”

After doing a little research; I found that When calling a stored procedure that has output parameters, the driver has to call the procedure using a remote procedure call (RPC). Stored procedures should be invoked using the special JDBC call escape syntax.

For example, {call stored_Proc1(?,?,?,?)}.

In this case the driver will be able to use an RPC successfully as all the parameters are represented by parameter markers (?). If however parameters are supplied as a mixture of parameter markers and literals,

for example {call stored_Proc1(?,’ ‘,?,0)}

Then the driver is unable to use an RPC and therefore cannot return output parameters. In these circumstances the driver raises the above exception and execution fails.

It is possible to use mixed parameter lists to call stored procedures that do not have output parameters. In this case the driver will substitute the parameters locally and use a normal “execute procedure” SQL call; however, this mode of execution is less efficient than an RPC.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • IndianPad
  • Reddit
Categories: Programming / tutorials Tags: , ,
  1. sadhna
    August 25th, 2011 at 09:14 | #1

    thanks Param. I am glad that it was helpful.

  2. Param
    August 21st, 2011 at 21:24 | #2

    thanks a lot. saved me a lot of trouble.

  1. No trackbacks yet.
Get Adobe Flash playerPlugin by wpburn.com wordpress themes