Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prepared Statements Limited in Size??

 
Gale Greaser
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
Here is the Prepared Statement I am trying to execute:
ps.modifyRecord = "UPDATE Log SET date_recv = ?, patient_name = ?, is_new_patient = ?, med_rec_nbr = ?, person_recv_intake = ?, uwhc_uwmf = ?, responsible_party = ?, address = ?, zipcode = ?, birthdate = ?, referred_by = ?, prev_med_care = ?, prim_care_physician = ?, reason_left_prev_provider = ?, reason_for_visit = ?, statement_sent_recv = ?, appropriate_facility = ?, comments = ?, needs_fin_screening = ?, decision = ?, updated_by = ?, date_updated=default WHERE record_id = ?
* When I replace the question marks with real data, wrap it in a Java Statement, it works just fine.
* However, when I execute it as a prepared statement:
// Set SQL Insert Information
psInsert.setString( 1, "2/2/2000");
psInsert.setString( 2, "sd" );
psInsert.setString( 3, "sd" );
psInsert.setString( 4, "12" );
psInsert.setString( 5, "sd" );
psInsert.setString( 6, "sd");
psInsert.setString( 7, "sd");
psInsert.setString( 8, "sd" );
psInsert.setString( 9, "12" );
psInsert.setString( 10, "1/3/2000" );
psInsert.setString( 11, "sd" );
psInsert.setString( 12, "sd");
psInsert.setString( 13, "sd" );
psInsert.setString( 14, "sd" );
psInsert.setString( 15, "123" );
psInsert.setString( 16, "123" );
psInsert.setString( 17, "123" );
psInsert.setString( 18, "123" );
psInsert.setString( 19, "123" );
psInsert.setString( 20, "123");
psInsert.setString( 21, "user" );
psInsert.setString(22, "1");

// Execute
psInsert.executeUpdate();

... I get this error:
Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The identifier that starts with 'UPDATE Log SET date_recv = @P1, patient_name = @P2, is_new_patient = @P3, med_rec_nbr = @P4, person_recv_intake = @P5, uwhc_uwmf' is too long. Maximum length is 128.
* I'm terribly confused - can Prepared Statements only be of a finite size?
* Please help - Thanks in Advance!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic