CaseSensitiveCollation

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 07-Jul-2010 17:18:23   

In the below code, how do I set CaseSensitiveCollation=true

private static bool isduplicaterecord(string inputstring) // check duplicate records in table {

        var adapteraccountnature = new DataAccessAdapter();
        var accountnature = new AccountnatureEntity();

        accountnature.Description = ClubCentricBISpecific.ChangeCase.ToTitleCase(inputstring);
        accountnature.Flag = ClubCentricBISpecific.StandardFlag.recordvalidflag;
        adapteraccountnature.FetchEntityUsingUniqueConstraint(accountnature,
                                                                accountnature.ConstructFilterForUCDescriptionFlag());
        return (accountnature.Fields.State) == EntityState.Fetched;
    }
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Jul-2010 05:29:40   

What is the sql predicate you want to achieve? You can set CaseSensitiveCollation this way: .

..
IPredicateExpression filter = new PredicateExpression();

FieldLikePredicate filterUCCase1 = new FieldLikePredicate(AccountnaturFields.Description, null,
     ClubCentricBISpecific.ChangeCase.ToTitleCase(inputstring));
filterUCCase1.CaseSensitiveCollation = true;

FieldLikePredicate filterUCCase2 = new FieldLikePredicate(AccountnaturFields.Flag, null,
     ClubCentricBISpecific.StandardFlag.recordvalidflag));
filterUCCase2.CaseSensitiveCollation = true;

filter.Add(filterUCCase1);
filter.Add(filterUCCase2);

adapteraccountnature.FetchEntityUsingUniqueConstraint(accountnature,
     filter);
...

CaseSensitiveCollation = true, it will emit UPPER(...) for the involved fields so you must send UPPER strings for the values.

David Elizondo | LLBLGen Support Team
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 08-Jul-2010 05:56:12   

daelmo wrote:

What is the sql predicate you want to achieve? You can set CaseSensitiveCollation this way: .

..
IPredicateExpression filter = new PredicateExpression();

FieldLikePredicate filterUCCase1 = new FieldLikePredicate(AccountnaturFields.Description, null,
     ClubCentricBISpecific.ChangeCase.ToTitleCase(inputstring));
filterUCCase1.CaseSensitiveCollation = true;

FieldLikePredicate filterUCCase2 = new FieldLikePredicate(AccountnaturFields.Flag, null,
     ClubCentricBISpecific.StandardFlag.recordvalidflag));
filterUCCase2.CaseSensitiveCollation = true;

filter.Add(filterUCCase1);
filter.Add(filterUCCase2);

adapteraccountnature.FetchEntityUsingUniqueConstraint(accountnature,
     filter);
...

CaseSensitiveCollation = true, it will emit UPPER(...) for the involved fields so you must send UPPER strings for the values.

Thanks. It worked the way i wanted

saravana
User
Posts: 63
Joined: 11-Nov-2010
# Posted on: 10-Feb-2011 15:33:44   

Hi I tried the above code for Oracle 11g. It is not working. I am using Selfservicing method. whether the above implementation is different for self serviving?

Here is my code:


string searchTerm = languageTerm;
IPredicateExpression filter = new PredicateExpression();
FieldLikePredicate caseInSenstivefilter = 
                          new FieldLikePredicate (LanguagetermFields.Languageterm, searchTerm);
caseInSenstivefilter.CaseSensitiveCollation = false;
filter.Add(caseInSenstivefilter);

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 10-Feb-2011 21:09:11   

Set CaseSensitveCollation to true rather than false.

Matt