1 Reply Latest reply on Jul 18, 2002 6:31 PM by cdmdev

    CMP/BMP prepared statement issue

    cdmdev

      Has anyone had a problem using prepared statements with ? that return multiple rows? In my BMP bean I had the following prepared statement:

      pstmt = conn.prepareStatement("select "+HDT +" from "+TABLE_NAME+" where "+HUB_NAME+" = ?");

      pstmt.setString(1,hub);

      This would return nothing when executed, but when I created a prepared statemnt as follows it worked:

      pstmt = conn.prepareStatement("select "+HDT+" from "+TABLE_NAME+" where "+HUB_NAME+" = '"+hub+"'");


      The reason I am asking is because I am now using CMP and I am seeing the same response when it tries to plug in my "hub" for the ?. Here is the server debug of the CMP prepared statement:

      Executing SQL: SELECT t0_a.hdt FROM HDT t0_a WHERE t0_a.hub_name = ?


      Any ideas, would be greatly appreciated.

      Brent