• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic