| Author |
UPPERing in a prepared statement
|
Ali Ekber
Ranch Hand
Joined: Jun 12, 2005
Posts: 41
|
|
I need to upper a search criteria in the WHERE clause in a prepared statement. It is something like this: ... WHERE name=UPPER(?); But it doesn't work. Is it possible to do UPPER in prepared statement, with a different syntax? Thx.
|
 |
Prabhu Venkatachalam
Ranch Hand
Joined: Nov 16, 2005
Posts: 502
|
|
SQL you write differs from one database to others. so can you please tell us which DB are you using? Before that, my advice is to convert the value you want to convert to uppercase using Java(String.toUpperCase()) then you set as value to your pre compiled query.
|
Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
|
 |
Ali Ekber
Ranch Hand
Joined: Jun 12, 2005
Posts: 41
|
|
|
This is a DB2 instance. Thx.
|
 |
Prabhu Venkatachalam
Ranch Hand
Joined: Nov 16, 2005
Posts: 502
|
|
This should work. Try this,
|
 |
Prabhu Venkatachalam
Ranch Hand
Joined: Nov 16, 2005
Posts: 502
|
|
before adding this query to Java, try in DB2 using some SQL editor with some hard coded value. If it works, then this should work with Java as well. Thanks.
|
 |
Carol Enderlin
drifter
Ranch Hand
Joined: Oct 10, 2000
Posts: 1348
|
|
|
This is a duplicate of post in same forum with same subject
|
 |
 |
|
|
subject: UPPERing in a prepared statement
|
|
|