Wildcard search / search string evaluation
I defined the wildcard as "%" (this is proposed in all examples I've seen):
<Property Name="WildcardCharacter" Type="System.String">%</Property>
I've a SQL statement defined:
Select Uid,firstname,lastname From dbo.Participant WHERE (Uid>=@GeneratedMinUid) and (Uid<=@GeneratedMaxUid) AND (lastname LIKE @lastname)
The part "(Uid>=@GeneratedMinUid) and (Uid<=@GeneratedMaxUid)" is generated by the BDC Meta Man. Even that "Uid" is a string the "°<="/"<=" is being constructed!
Why not just:
(Uid = @GeneratedUid)
My problem ist that the SQL evaluates to (I just search for the lastname and the other parameters are filled with a wildcard):
Select Uid,firstname,lastname From dbo.Participant WHERE (Uid>='%') and (Uid<='%') AND (lastname LIKE 'searchName')
Is this correct?
And this search string doesn't return the lastnames witch 'searchName' because "(Uid>='%') and (Uid<='%')" is never true for my "searchName"!
The server log contains this:
Select Uid,firstname,lastname From dbo.Participant WHERE (Uid>=@GeneratedMinUid) and (Uid<=@GeneratedMaxUid) AND (lastname LIKE @lastname)
Parameter Signature: System.String @GeneratedMinUid, System.String @GeneratedMaxUid, System.String @lastname,
Parameter Values:
Queried 0 TypeDescriptor records for TypeDescriptor with Id '3433'
Queried 0 TypeDescriptor records for TypeDescriptor with Id '3435'
Queried 0 TypeDescriptor records for TypeDescriptor with Id '3437'
Parameter'@GeneratedMinUid':
TypeDesc Uid: %
Parameter'@GeneratedMaxUid':
TypeDesc Uid: %
Parameter'@lastname':
TypeDesc lastname: 1111
Finished executing query
Instantiating Type 'System.String'.
Recursively instantiating Type 'System.String' at a nest level of '0'.
Found default value '%'; returning that instead of instantiating at a nest level of '0'.
Completely instantiated Type 'System.String'.
Instantiating Type 'System.String'.
Recursively instantiating Type 'System.String' at a nest level of '0'.
Found default value '%'; returning that instead of instantiating at a nest level of '0'.
Completely instantiated Type 'System.String'.
Instantiating Type 'System.String'.
Recursively instantiating Type 'System.String' at a nest level of '0'.
Found default value '%'; returning that instead of instantiating at a nest level of '0'.
Completely instantiated Type 'System.String'.

