on 09-23-2004 5:59 PM
Hi
I need to have a select statement like:
<b><i>SELECT C1,C2 from T1 where upper(C1) like upper(:val_c1)</i></b>
But SQLJ translator complains about upper.
Any suggestion?
TIA
Hi,
SQLJ works on the Open SQL level, which means that basically entry level SQL-92 is supported (and few intermediate SQL features as well, such as joins), while support for functions such as LOWER and UPPER is part of the full SQL-92. For more information about the Open SQL grammar, please have a look at the documentation at http://help.sap.com/saphelp_nw04/helpdata/en/9b/f46cabaa874bc9a82234e8cf1d0696/frameset.htm.
Zornitsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I think you should use both SQLJ and JDBC with native SQL access to execute the database-specific statements. You can have a look at the documentation about combining SQLJ and JDBC (http://help.sap.com/saphelp_nw04/helpdata/en/b5/f5bb805b2e9243ac9a1eafc4ecbd5f/frameset.htm) and about native SQL access (http://help.sap.com/saphelp_nw04/helpdata/en/51/ef9f94e4ba894d8e93b2eed7c9f82d/frameset.htm).
Regards,
Zornitsa
Hi,
the Open SQL grammar does not provide the upper function because the semantics of UPPER are database dependent. (It works fine for a...Z, of course, but for slightly more exotic characters, the behavior differs from database to database). So please be aware that you might run into porting issues, if you use UPPER on Native SQL.
Also, please note that the database can't use an index, if you the UPPER function.
A more general solution for you issue would be to store your data in a normalized way. E.g. in upper case, trimmed from leading and trailing spaces, normalized according to phonetic similarity, ... whatsoever.
If you keep your data normalized, you can easily retrieve the data again and avoid duplicates.
Adrian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.