I am trying to use Upper() or Lower() combined with VBscript ucase/lcase to perform a case-insensitive search on DB2. My script produces SQL like the following:
Select * From INFO, Sources, Banks, Services, Verify, Importance WHERE Verify.VerifyID = Info.Quality AND Importance.ImportanceID = Info.Importance AND (Info.SourceCode = Sources.SourceID) AND (Info.BankCode = Banks.BankID) AND (Info.ServiceCode = Services.ServiceID) AND ( lower(SERVICENAME) LIKE '%test%' OR lower(ACTCODE) LIKE '%test%' OR lower(BANKNAME) LIKE '%test%' OR lower(TITLE) LIKE '%test%' OR lower(PRICE) LIKE '%test%' OR lower(NOTES) LIKE '%test%' OR lower(SOURCENAME) LIKE '%test%' OR lower(USER) LIKE '%test%' )
From everything I've read on using these functions in DB2 this looks like good SQL, but it produces this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[IBM][CLI Driver][DB2/NT] SQL0440N No function by the name "LOWER" having compatible arguments was found in the function path. SQLSTATE=42884
Any help would be greatly appreciated. The columns being searched are all varchar or long varchar.
Select * From INFO, Sources, Banks, Services, Verify, Importance WHERE Verify.VerifyID = Info.Quality AND Importance.ImportanceID = Info.Importance AND (Info.SourceCode = Sources.SourceID) AND (Info.BankCode = Banks.BankID) AND (Info.ServiceCode = Services.ServiceID) AND ( lower(SERVICENAME) LIKE '%test%' OR lower(ACTCODE) LIKE '%test%' OR lower(BANKNAME) LIKE '%test%' OR lower(TITLE) LIKE '%test%' OR lower(PRICE) LIKE '%test%' OR lower(NOTES) LIKE '%test%' OR lower(SOURCENAME) LIKE '%test%' OR lower(USER) LIKE '%test%' )
From everything I've read on using these functions in DB2 this looks like good SQL, but it produces this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[IBM][CLI Driver][DB2/NT] SQL0440N No function by the name "LOWER" having compatible arguments was found in the function path. SQLSTATE=42884
Any help would be greatly appreciated. The columns being searched are all varchar or long varchar.