This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in Insert Query using Perpared statments

 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,
I am tring to write a query using PSTMT but it throws me this error:
SQLException: Parameter index out of range (4 > number of parameters, which is 3).
SQLState: S1009
VendorError: 0
SQLException: Parameter index out of range (4 > number of parameters, which is 3).
SQLState: S1009
VendorError: 0
SQLException: Parameter index out of range (4 > number of parameters, which is 3).
SQLState: S1009
VendorError: 0

, here is the insert code and the trigger code:
Insert Query:



and trigger code:


do you have any idea whats wrong?

Thanks!
Sahar.


 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your insert sql statement there exists 3 question marks(?), but you are trying to set the 4th ? as I see in your post line number 13.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic