[Fwd: Case Insensitive Search]

1 view
Skip to first unread message

Andrew Myers

unread,
Jul 11, 2008, 7:01:18 AM7/11/08
to transf...@googlegroups.com
Hi,

When using TQL is it possible to do a case insensitive search?

eg I have:

select *
from
Recruitment.Application
join Recruitment.Status
join Recruitment.Applicant
join Recruitment.Position
where
Recruitment.Position.position_id = :positionId
and Recruitment.Applicant.first_name like :firstName

I am right to assume that I can't use
Upper(Recruitment.Applicant.first_name), because Upper() is a DB function?

Is there any workaround for this (that is a bit less painless than
creating a separate db column with the text in uppercase)?

Thanks,
Andrew.


mrad...@googlemail.com

unread,
Jul 11, 2008, 12:55:48 PM7/11/08
to transf...@googlegroups.com
AFAIK, by default, the most common SQL engines are case insenstive.
your code should work fine.

Maybe silly question, but are you adding the percent signs in when
you're doing your setParam? e.g.

tquery.setParam( "firstName", "%"&arguments.firstName&"%", "string")>

Andrew

unread,
Jul 12, 2008, 4:32:24 AM7/12/08
to transfer-dev
Yes, I have added the % signs. I didn't try the "Upper()" in my
tSql. Without it (on Oracle 10g at least) search is case sensitive.
Will the upper() work in TSQL? I didn't try...

Mark Mandel

unread,
Jul 13, 2008, 5:54:35 PM7/13/08
to transf...@googlegroups.com

mrad...@googlemail.com

unread,
Jul 14, 2008, 5:32:55 AM7/14/08
to transf...@googlegroups.com
What happens if you run this in its own cfquery prior to running the tql?

alter session set NLS_COMP=LINGUISTIC;

Andrew

unread,
Jul 22, 2008, 3:03:16 AM7/22/08
to transfer-dev
Hi,

What's the implications of doing this? Will it affect other SQL's
running on the same datasource?

On Jul 14, 7:32 pm, mradri...@googlemail.com wrote:
> What happens if you run this in its own cfquery prior to running the tql?
>
> alter session set NLS_COMP=LINGUISTIC;
>
> On 13/07/2008, Mark Mandel <mark.man...@gmail.com> wrote:
>
>
>
> > Sounds like a good enhancement request...
>
> >http://tracker.transfer-orm.com/issue.cfm?p=89977683-A728-9CD3-ABD954...
> > E: mark.man...@gmail.com
> > W:www.compoundtheory.com

Mark Mandel

unread,
Jul 22, 2008, 3:04:36 AM7/22/08
to transf...@googlegroups.com
Of course.. you could just write regular SQL ;o)

Mark

--
E: mark....@gmail.com
W: www.compoundtheory.com

mrad...@googlemail.com

unread,
Jul 22, 2008, 4:21:55 AM7/22/08
to transf...@googlegroups.com
I suspect that if you have CF set to maintain connections, then yes it
would make all SQL case insensitive on that datasource.

Andrew

unread,
Jul 22, 2008, 7:02:21 AM7/22/08
to transfer-dev
Hi Mark,

I think that's going to be my solution.

At a guess how difficult will it be to implement the upper() function
in TQL? Is it something I could have a look at?
> E: mark.man...@gmail.com
> W:www.compoundtheory.com

Andrew

unread,
Jul 22, 2008, 7:03:30 AM7/22/08
to transfer-dev
Thanks for that. Doesn't sound like the solution I'm after, but
thanks for the suggestion. :-)

Mark Mandel

unread,
Jul 22, 2008, 7:26:25 AM7/22/08
to transf...@googlegroups.com
You could, but the TQL parser needs a rewrite, as it could be written
way better, to be more flexible.

Feel free to have a look if you want.

Mark

--
E: mark....@gmail.com
W: www.compoundtheory.com

Reply all
Reply to author
Forward
0 new messages