I have to admit that I thought most databases were inherently
case-insensitive when it came to LIKE operators. In fact, I have code
in to ensure that Derby is case-insensitive.
If they all can be case sensitive, then I would think this is a really
good idea. If not, then it would introduce a feature that can't be
universally supported (an anathema to DataMgr).
What database are you using right now?
Assuming it can be universal, what would you think about another
argument/attribute for the filter to indicate that?
Thanks,
Steve
> --
> You received this message because you are subscribed to the Google Groups "DataMgr" group.
> To post to this group, send email to dat...@googlegroups.com.
> To unsubscribe from this group, send email to datamgr+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/datamgr?hl=en.
>
>
That sounds like a good solution for now.
It looks like SQL Server, at least, is not case sensitive for LIKE statements.
http://www.bennadel.com/blog/723-SQL-Server-Text-Matching-Is-Case-INSENSITIVE.htm
This implies, to me, that all LIKE searches done through DataMgr (not
using custom SQL) should be case insensitive. My thinking is that the
same DataMgr statement (so long as it doesn't include custom SQL) on
the same data should return the exact same result regardless of the
database platform.
Anyone have any thoughts on this?
Thanks,
Steve
You can use the following command to determine the settings for your particular installation.
<Cfquery name="helpsort">
sp_helpsort
</Cfquery>
<cfdump var="#helpsort#" label="COLLATIONINFO" expand="yes">
Hope that helps.
--
Sean Ford
SPF Management, LLC
c: 305.788.3673
e: se...@seanford.com
w: http://seanford.com
w: http://twitter.com/seanford
w: http://facebook.com/seanpford
We have come from a MS SQL server background so case-insensitive LIKE
searches have been our norm. One of the reasons we had to moving to
using DataMgr for *everything* was to become completely database
agnostic for our OSS applications and obviously you want the DAL to be
consistent and not have to make code variations depending on database
under the DAL, it makes the whole point of DataMgr irrelevant.
So I would say be consistent above all else and in this case make LIKE
searches case-insensitive.
--
Yours,
Kym
It wouldn't be that hard to add a feature to indicate that you want
the statement to be case sensitive if possible, but I am not sure
about adding a feature that may or may not be supported across
databases (I could indicate the feature as such, but I have worked
pretty hard to make sure that DataMgr produces the exact same results
regardless of the database).
Of course, I could follow the path of the paging feature and do some
post-query work for case sensitivity in databases that are case
sensitive for LIKE searches.
Any thoughts?
Steve
I think in order to provide consistent results across databases and to
allow for case-sensitive searching I would have to make it
case-insensitive by default and allow for an option for
case-sensitive.
For databases that don't support it, however, I would have to do that
in post-processing of the query. In order to do that, however, the
column(s) in question would have to be in the result set - which they
might not be. I couldn't even really automatically add them to the
result set because the SQL might have a DISTINCT statement or a Max()
function or something where that would break the query.
In short, I just can't figure a way to support case-sensitive
searching and return the exact same results across all databases. I'm
open to suggestions, of course.
Steve
Salvatore
Can I politely disagree?
To my mind as a coder of multi-platform OSS I want to be completely
database agnostic, I want the end user to be able to use any database
behind our CMS without any code changes needing to be made. Every
database has to look the same to the codebase. If I start coding flags
and differences for each database's behaviour then what is the point of
using DataMgr, I might as well hard code for each DB.
I also see your point so it seems we have a quandary :-)
--
Yours,
Kym
:-)
> a simple question: suppose you have 2 databases:
> a) case -sensitive db (A)
> b) case insensitive db (B)
> the you develop a dataMgr- based app for these 2 db:
Do you meant that the app is running two different databases at once?
> do you thik:
>
> a) dataMgr has to return its results always case-sensitive for all db
> b) dataMgr has to return its results always case-insensitive for all
> db
> c) dataMgrmust be case sensitive for db A, and case insensitive for
> db B, depending on what db it drives
Any of the above, or all of them :-)
I believe more than anything else that I want to write code that does
not have to change depending on DB and it is also very convenient to be
able to specify whether a query is case-sensitive or not.
My ideal scenario is to have a flag/attribute to specify
case-sensitivity or not, with case-insensitive as the default. Obviously
using a database that is fixed in case and cannot change its sensitivity
is a limitation but that responsibility then moves to the developer/user
to not choose an impossible combination.
--
Yours,
Kym