[Opensource] wildcards for numbers?

Pierre Mergaux pmergaux at noos.fr
Sun Jan 19 02:54:06 PST 2003


larry hamel wrote:

>hi Pierre,
>
>can you help me understand?  you seem to be referring to this segment of code
>
>                if (containsWildCards(oneFieldValue)) {
>                    myStatement.append(oneFieldName);
>                    myStatement.append(" LIKE ");
>                    myStatement.append(oneFieldValue);
>
>and you want to have LIKE used with numeric fields?  why not use math comparisons (< >) ?
>
>of course, a string-field value should have quotes around it--is this not working with string fields?
>
>thanks,
>
>larry
>
>
>At 05:27 AM 1/18/2003, you wrote:
>  
>
>>Even if field is numeric DBOject generate a LIKE expression, but for example "like 546%" is not accept by SQL
>>I propose correct the DBOject as is :
>>
>>                  myStatement.append(" LIKE ");
>>                  if (oneFieldValue.startsWith("'")==true)
>>                      myStatement.append(oneFieldValue);
>>                  else
>>                  {
>>                      myStatement.append("'");
>>                      myStatement.append(oneFieldValue);
>>                      myStatement.append("'");
>>                  }
>>
>>PMX
>>
>>
>>_______________________________________________
>>Opensource mailing list
>>Opensource at jcorporate.com
>>http://mail.jcorporate.com/mailman/listinfo/opensource
>>Archives: http://mail.jcorporate.com/pipermail/opensource/
>>    
>>
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
>
>  
>
Your proposal : we need 2 values (> first and < second)., or calculate 
this two with the 'oneFieldValue', then we need know the format of the 
numeric field.
My proposal is *only to void sql error*, and to display results.

For example : for '12%' sql answer all records with 12, 120 to 129, 1200 
to 1299 etc...

PMX

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.jcorporate.com/pipermail/opensource/attachments/20030119/78de4754/attachment-0002.htm


More information about the Opensource mailing list