firebird case insensitive search

Posts   
 
    
ptrevizo
User
Posts: 4
Joined: 12-Sep-2005
# Posted on: 19-Jan-2006 18:13:07   

I'm having some trouble with case insensitive searching. From what I read about here, I think I am doing this right. Here is a snippet of my llblgen code:

Dim dap As New DataAccessAdapter
Dim bucket As New RelationPredicateBucket
Dim entities As New EntityCollection(New HazmatEntityFactory)
Dim p As FieldLikePredicate

bucket.Relations.Add(HazmatEntity.Relations.RegulationEntityUsingRegulationID)
bucket.PredicateExpression.Add(PredicateFactory.CompareValue(LLBL.RegulationFieldIndex.RegulationName, ComparisonOperator.Equal, regset))

If (psn.Length > 0) Then
    p = PredicateFactory.Like(LLBL.HazmatFieldIndex.PSN, "%" + psn.ToUpper + "%")
    p.CaseSensitiveCollation = True
    bucket.PredicateExpression.AddWithAnd(p)
End If

dap.FetchEntityCollection(entities, bucket)

Everytime I run it, it gives me an empty collection even though I put in a paramater (the string 'psn') that I know exisits in my table. Here is my table creation:

Create Table tblHZ  (
    HZID Integer NOT NULL,
    PSN Varchar(252) NOT NULL COLLATE ASCII,
    UNID Varchar(50) NOT NULL COLLATE ASCII,
    Class Varchar(20) NOT NULL COLLATE ASCII,
    Group Varchar(50) NOT NULL COLLATE ASCII,
    Data Varchar(2000),
    RegulationID Integer NOT NULL,
    HZHashKey Varchar(64) NOT NULL UNIQUE,
 Primary Key (HazmatID)
);

Is there something that I am missing?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 18:23:13   

Please enable tracing for the firebird DQE and run the app in debug mode, you'll then see the query produced and the parameters sent. Please paste the query / trace log. See 'troubleshooting and debugging' in the manual for details about tracing

Frans Bouma | Lead developer LLBLGen Pro
ptrevizo
User
Posts: 4
Joined: 12-Sep-2005
# Posted on: 19-Jan-2006 19:09:18   

Here is the output from my debug window at the spot I do the query:

Method Enter: DataAccessAdapterBase.FetchEntityCollection(6)
Method Enter: CreatePagingSelectDQ
Method Enter: CreateSelectDQ
Method Enter: CreateSelectDQ
Generated Sql query: 
    Query: SELECT DISTINCT TBLHZ.HZID AS HazmatID, TBLHZ.PSN, TBLHZ.UNID, TBLHZ.CLASS AS Class, TBLHZ.GROUP AS Group, TBLHZ.DATA AS Data, TBLHZ.REGULATIONID AS RegulationID, TBLHZ.HZHASHKEY AS HazmatHashKey FROM ( TBLREGULATION  INNER JOIN TBLHZ  ON  TBLREGULATION.REGULATIONID=TBLHZ.REGULATIONID) WHERE ( TBLREGULATION.REGULATIONNAME = @RegulationName1 AND (TBLHZ.PSN) LIKE @PSN2)
    Parameter: @RegulationName1 : String. Length: 20. Precision: 0. Scale: 0. Direction: Input. Value: FX.
    Parameter: @PSN2 : String. Length: 6. Precision: 0. Scale: 0. Direction: Input. Value: %ACID%.
Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
Method Enter: DataAccessAdapterBase.ExecuteMultiRowRetrievalQuery
Method Enter: DataAccessAdapterBase.OpenConnection
Method Exit: DataAccessAdapterBase.OpenConnection
Method Enter: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.ExecuteMultiRowRetrievalQuery
Method Exit: DataAccessAdapterBase.FetchEntityCollection(6)
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 22:00:47   

Bug in the Firebird DQE. Apparently the UPPER function method isn't overriden. flushed

This is fixed in the next build. I'll update the hotfix for the runtimes with this fix.

(edit) fix is now available)

Frans Bouma | Lead developer LLBLGen Pro
ptrevizo
User
Posts: 4
Joined: 12-Sep-2005
# Posted on: 19-Jan-2006 22:25:26   

Thanks, I appreciate your help!