• 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

How to search record on (firstname+lastname) or (lastname+firstname)? please help me

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I need your help to resolve the following issue.please, help me.
I need to search employee on (firstname+lastname) or (lastname+firstname). SQL-2000 is DB.
the piece of code is as follows


On execution, I am getting "nested exception is: java.sql.SQLException: [IBM][SQLServer JDBC Driver]Invalid parameter binding(s). "

How to resolve? please, help me.

regards
Gautam


 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the SQL behind qryforEmployeeSearch_fullname ?
 
Gautam Ry
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is as below

private static final String qryforEmployeeSearch_fullname ="select e.emp_eid, rtrim(ltrim(e.emp_firstname)) +' '+rtrim(ltrim(emp_lastname))+' ['+e.emp_eid+']' as emp_name," +
" e.emp_tm_tid as teamname from tblEmployee e where " +
"(e.emp_lastname like ? and e.emp_firstname like ?)or (e.emp_firstname like ? and e.emp_lastname like ?) order by e.emp_firstname ";

regards
Gautam
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you have four bind parameters declared but you only bind two. You'll need to bind all of these.
 
Gautam Ry
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
many many thanks to you. it's working as i changed
regards
gautam
 
reply
    Bookmark Topic Watch Topic
  • New Topic