• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

error in Insert Query using Perpared statments

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic