I'm having great difficultly making my DB2 (AS/400) queries case insensitive.
For example:
SELECT *
FROM NameTable
WHERE LastName = 'smith'
Will return no results, but the following returns 1000's of results:
SELECT *
FROM NameTable
WHERE LastName = 'Smith'
I've read of putting SortSequence/SortType into your connection string but have had no luck... anyone have exepierence with this?
Edit:
Here's the stored procedure:
BEGIN
DECLARE CR CURSOR FOR
SELECT T . ID ,
T . LASTNAME ,
T . FIRSTNAME ,
T . MIDDLENAME ,
T . STREETNAME || ' ' || T . ADDRESS2 || ' ' || T . CITY || ' ' || T . STATE || ' ' || T . ZIPCODE AS ADDRESS ,
T . GENDER ,
T . DOB ,
T . SSN ,
T . OTHERINFO ,
T . APPLICATION
FROM
( SELECT R . * , ROW_NUMBER ( ) OVER ( ) AS ROW_NUM
FROM CPSAB32.VW_MYVIEW
WHERE R . LASTNAME = IFNULL ( @LASTNAME , LASTNAME )
AND R . FIRSTNAME = IFNULL ( @FIRSTNAME , FIRSTNAME )
AND R . MIDDLENAME = IFNULL ( @MIDDLENAME , MIDDLENAME )
AND R . DOB = IFNULL ( @DOB , DOB )
AND R . STREETNAME = IFNULL ( @STREETNAME , STREETNAME )
AND R . CITY = IFNULL ( @CITY , CITY )
AND R . STATE = IFNULL ( @STATE , STATE )
AND R . ZIPCODE = IFNULL ( @ZIPCODE , ZIPCODE )
AND R . SSN = IFNULL ( @SSN , SSN )
FETCH FIRST 500 ROWS ONLY )
AS T
WHERE ROW_NUM <= @MAXRECORDS
OPTIMIZE FOR 500 ROW ;
OPEN CR ;
RETURN ;