Filter based on string data type fields not return any results

Posts   
 
    
saravana
User
Posts: 63
Joined: 11-Nov-2010
# Posted on: 13-Jan-2012 11:15:00   

Hi,

I am trying to get the entity by filtering based on string field (non PK/FK). But in the resultant query the parameter is always passed with double quotes. This did not yield the expected results.



Query: SELECT "AUTHORIZEDENTITY"."ENTITYID" AS "Entityid", "AUTHORIZEDENTITY"."SHORTNAME" AS "Shortname", "AUTHORIZEDENTITY"."VALIDFROM" AS "Validfrom", "AUTHORIZEDENTITY"."VALIDTO" AS "Validto" FROM "AUTHORIZEDENTITY" WHERE ( ( "AUTHORIZEDENTITY"."SHORTNAME" = :p1))
    
Parameter: :p1 : String. Length: 20. Precision: 0. Scale: 0. Direction: Input. Value: "ADM".

If I pass the value within a single quote it works fine. The C# code is as follows:


ExcludeIncludeFieldsList excludedFields = new ExcludeIncludeFieldsList();
                excludedFields.Add(AuthorizedentityFields.Name);
                IPredicateExpression filter = new PredicateExpression(AuthorizedentityFields.Shortname == strShortName);
                authorizedEntityCollection.GetMulti(filter, 0, null, null, null, excludedFields, 0, 0);

Is there any issue in the above code?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Jan-2012 19:16:43   

What LLBLGen version and runtime library version are you using? (http://llblgen.com/tinyforum/Messages.aspx?ThreadID=7725)

Does that query returns the expected results if you hit it at DB directly (i.e. query analyzer)?

What DB are you using?

David Elizondo | LLBLGen Support Team