Sunday, November 6, 2011

ORA-01006: bind variable does not exist

Hi,

Recently one of my collegue faced an error as "ORA-01006: bind variable does not exist". We could'nt rectify the reason for this error, later on, we discovered that there was a comma missing in callable statement parameter declaration.

it was something like ::

  CallableStatement cstmt =
             dbConnection.prepareCall("{call my_new_proc(?,?,?,?" + "?,?" +")}");


which should be like ::

  CallableStatement cstmt =
             dbConnection.prepareCall("{call my_new_proc(?,?,?,?" + ",?,?" +")}");


There can be many reasons for this error, but the one which we discovered was this one.

Cheers,

Ujjwal Soni