+ Reply to Thread
Results 1 to 3 of 3

java.sql.SQLException: ORA-01006: bind variable does not exist

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    Default java.sql.SQLException: ORA-01006: bind variable does not exist

    ps = conn.prepareStatement(" UPDATE USF_HEA_BENEFIT_AMOUNTS
    SET " +
    " BENEFIT_1_2_AMT = ?, " +
    " BENEFIT_3_5_AMT = ?, " +
    " BENEFIT_6_PLUS_AMT = ?, "
    +
    " CREATED_BY = '?' " +
    " WHERE " +
    " HEA_BENEFIT_CATEGORY_CDE =
    '?' AND " +
    "
    HEA_BENEFIT_FUEL_CATEGORY_CDE = '?' AND " +
    " INCOME_LEVEL = ? AND " +
    " HEATING_SEASON = ? " );





    ps.setInt(1, 5)
    ps.setInt(2, 6);
    ps.setInt(3, 7]);
    ps.setString(4, loginId);
    ps.setString(5, "O");
    ps.setString(6, "E");
    ps.setInt(7, 668);
    ps.setInt(8,07 );
    count = ps.executeUpdate();


    i provide all 8 parameters and the query is working fin in toad
    but when i am executing i am getting

    java.sql.SQLException: ORA-01006: bind variable does not exist

    any suggestions


  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    Default Re: java.sql.SQLException: ORA-01006: bind variable does not exist


    sunil(nani) wrote:
    > ps = conn.prepareStatement(" UPDATE USF_HEA_BENEFIT_AMOUNTS
    > SET " +
    > " BENEFIT_1_2_AMT = ?, " +
    > " BENEFIT_3_5_AMT = ?, " +
    > " BENEFIT_6_PLUS_AMT = ?, "
    > +
    > " CREATED_BY = '?' " +
    > " WHERE " +
    > " HEA_BENEFIT_CATEGORY_CDE =
    > '?' AND " +
    > "
    > HEA_BENEFIT_FUEL_CATEGORY_CDE = '?' AND " +
    > " INCOME_LEVEL = ? AND " +
    > " HEATING_SEASON = ? " );
    >
    >
    >
    >
    >
    > ps.setInt(1, 5)
    > ps.setInt(2, 6);
    > ps.setInt(3, 7]);
    > ps.setString(4, loginId);
    > ps.setString(5, "O");
    > ps.setString(6, "E");
    > ps.setInt(7, 668);
    > ps.setInt(8,07 );
    > count = ps.executeUpdate();
    >
    >
    > i provide all 8 parameters and the query is working fin in toad
    > but when i am executing i am getting
    >
    > java.sql.SQLException: ORA-01006: bind variable does not exist
    >
    > any suggestions


    Get rid of the quotes around your string parameter markers in the SQL.
    Quotes are for literal fixed strings, not variables. All variables are
    marked
    with plain question marks.
    Joe


  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    Default Re: java.sql.SQLException: ORA-01006: bind variable does not exist

    thank you


+ Reply to Thread

Similar Threads

  1. System.Data.SqlClient.SqlException: Must declare the variable '@I
    By Application Development in forum ADO DAO RDO RDS
    Replies: 0
    Last Post: 12-13-2005, 04:42 PM
  2. Order in bind variable for PreparedStatement in Java
    By Application Development in forum JDBC JAVA
    Replies: 1
    Last Post: 05-11-2005, 04:32 PM
  3. Replies: 1
    Last Post: 10-31-2003, 04:08 PM
  4. Replies: 3
    Last Post: 09-24-2003, 04:47 AM
  5. Replies: 0
    Last Post: 09-19-2003, 07:11 AM