Click here to Skip to main content
14,836,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Folks,

I have a search string and I need to display the words similar to that search string from a particular Oracle DataTable.

I am able to do that but since the search is through the entire
DataTable it's time consuming, thus creating a performance issue.

Please suggest how do I go for it.
Posted
Updated 24-Nov-10 5:52am
v2
Comments
RDBurmon 15-Nov-10 8:11am
   
can you clarify more ? like the table name / stucture / search strin example / output example
RoopikaS 15-Nov-10 22:03pm
   
Hey Rahul, Thanks for your reply, But my concern was, I am trying to search a string from table, I do know the Column name of the same,and am searching the user entered Search String in that particular Column Code OracleConnection Oracon = new OracleConnection(sql); OracleDataAdapter dataAdapter = new OracleDataAdapter("SELECT * FROM MY_TABLE", Oracon); dt = new DataTable(); dataAdapter.Fill(dt); DataView dv1 = new DataView(dt); foreach (DataRow row in dt.Select()) { dBStrings.Add(row["VALUE_NAME"].ToString()); // Do something with columnValue } This is the way Im getting the values from Table and then I am carrying out Search on it..The issue is since the entries in Column are too many, it is taking a lot of time to load things up.. Please guide me for the same.
Henry Minute 24-Nov-10 11:55am
   
Does Orrible :) have a feature like the Full Text Search feature of MSSql? If so that might help a little.

You seem to load the entire table into the data table and then search the data table in your C# code. This is the most horrible thing to do. Instead search data in your SQL code and bring only those rows that match the search criteria.
SQL
SELECT Col1, Col2, .... 
FROM MyTable 
WHERE Col1 LIKE '%<<searchText>>%'
OR Col2 LIKE '%<<searchText>>%'
OR ............

Create Indexes on the columns that you are searching. It might help.
   
Comments
thatraja 15-Jul-11 23:18pm
   
Nice suggestion, 5!
Take a look at Oracle Text[^]

Best regards
Espen Harlinn
   
Comments
thatraja 15-Jul-11 23:18pm
   
Good guide, 5!
Espen Harlinn 16-Jul-11 4:38am
   
Thank you, thatraja!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900