| Author |
How to search record on (firstname+lastname) or (lastname+firstname)? please help me
|
Gautam Ry
Ranch Hand
Joined: Dec 30, 2008
Posts: 41
|
|
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
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
What is the SQL behind qryforEmployeeSearch_fullname ?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Gautam Ry
Ranch Hand
Joined: Dec 30, 2008
Posts: 41
|
|
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
Joined: Apr 14, 2004
Posts: 10336
|
|
|
So you have four bind parameters declared but you only bind two. You'll need to bind all of these.
|
 |
Gautam Ry
Ranch Hand
Joined: Dec 30, 2008
Posts: 41
|
|
many many thanks to you. it's working as i changed
regards
gautam
|
 |
 |
|
|
subject: How to search record on (firstname+lastname) or (lastname+firstname)? please help me
|
|
|