Dynamically Changing Oracle NLS property inside Rails application

35 views
Skip to first unread message

RORACLE

unread,
Jan 3, 2013, 12:33:05 AM1/3/13
to oracle-...@googlegroups.com
Hello,

To achieve case insensitivity for searching records in a ROR application, I am modifying the NLS property (NLS_COMP) to the required value and setting it back to the default value (which is for case sensitivity).  Do you think changing NLS properties of a database session dynamically inside a model will affect the Application/DB performance? Or is there any alternative better way to do that? Because i am seeing that my applicaiton works very slow after this change (may be after this change? Not sure... i am investigating it. just wanted to verify it by getting suggestions from our forum :) ) Please note that i need both case insensitivity (for one piece of functionality) and case sensitivity for another functionality, so i dont want to set it in the database.yml level.

Please advice

Thanks,
Neo

Frank Behrens

unread,
Jan 3, 2013, 11:36:56 AM1/3/13
to oracle-...@googlegroups.com
Dear Neo, 

posting your code (linking to a gist if its too much) would be helpful.
You can archive case insensitivity for some queries by lowercase the search values
iE   where( "lower(name) =  ?", value.downcase )   (i am not sure about the where syntax)

It might be increasing performance l to create a index for that lowercase query
CREATE INDEX "IDX_PEOPLE_LNAME" ON "PEOPLE" (LOWER("NAME"))

Frank


Frank Behrens:
  :mobile: +49 178 8862743



--
You received this message because you are subscribed to the Google Groups "Oracle enhanced adapter for ActiveRecord" group.
To view this discussion on the web visit https://groups.google.com/d/msg/oracle-enhanced/-/G-CANeGTK2sJ.
To post to this group, send email to oracle-...@googlegroups.com.
To unsubscribe from this group, send email to oracle-enhanc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/oracle-enhanced?hl=en.

Reply all
Reply to author
Forward
0 new messages