473,806 Members | 2,879 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Oracle Text with Numbers

Hello,

I need to search in a number column for particular "subnumbers ". For
example I have a column with 3453454 in it an I like to searh for the
number "53" in it. I know I could use

select * from table where number_column like '%53%'

but since the table is rather big I'd like to use Oracle Text for it
and query like

select * from table where contains(number _column, 53) > 0

but above query would return NULL after converting the number column
to a varchar2 column! Only full numbers are indexed and therefore only
a search on the full number 3453454 would yield a result. What are my
options to make above query with "contains" clause work?

Thanks in advance
Jul 19 '05 #1
3 7717

"Michael" <ms*******@hotm ail.com> wrote in message
news:e7******** *************** ***@posting.goo gle.com...
Hello,

I need to search in a number column for particular "subnumbers ". For
example I have a column with 3453454 in it an I like to searh for the
number "53" in it. I know I could use

select * from table where number_column like '%53%'

but since the table is rather big I'd like to use Oracle Text for it
and query like

select * from table where contains(number _column, 53) > 0

but above query would return NULL after converting the number column
to a varchar2 column! Only full numbers are indexed and therefore only
a search on the full number 3453454 would yield a result. What are my
options to make above query with "contains" clause work?

Thanks in advance

Oracle text won't help since Oracle Text is looking for words not
substrings. I can't think of a Mathmatical transformation that would then
use an index on the column. Is it always 53 or could it be any substring?
If it was always 53 then you could have a function based index. I think you
are going to have to do:
select * from table where to_char(number_ column) like '%53%' and have to do
a full table scan.
Jim
Jul 19 '05 #2
"Jim Kennedy" <ke************ *************** *@attbi.net> wrote in message news:<utQpc.619 46$z06.8535347@ attbi_s01>...
"Michael" <ms*******@hotm ail.com> wrote in message
news:e7******** *************** ***@posting.goo gle.com...
Hello,

I need to search in a number column for particular "subnumbers ". For
example I have a column with 3453454 in it an I like to searh for the
number "53" in it. I know I could use

select * from table where number_column like '%53%'

but since the table is rather big I'd like to use Oracle Text for it
and query like

select * from table where contains(number _column, 53) > 0

but above query would return NULL after converting the number column
to a varchar2 column! Only full numbers are indexed and therefore only
a search on the full number 3453454 would yield a result. What are my
options to make above query with "contains" clause work?

Thanks in advance

Oracle text won't help since Oracle Text is looking for words not
substrings. I can't think of a Mathmatical transformation that would then
use an index on the column. Is it always 53 or could it be any substring?
If it was always 53 then you could have a function based index. I think you
are going to have to do:
select * from table where to_char(number_ column) like '%53%' and have to do
a full table scan.
Jim


Thanks for your prompt reply.

it could be any substring, thats why I need sth.like above query

select * from table where contains(number _column, '234') > 0

there must be a (better) solution to avoid the full table scan. Any
other opinions,sugges tions?

Thanks, Michael
Jul 19 '05 #3

"Michael" <ms*******@hotm ail.com> wrote in message
news:e7******** *************** ***@posting.goo gle.com...
"Jim Kennedy" <ke************ *************** *@attbi.net> wrote in message

news:<utQpc.619 46$z06.8535347@ attbi_s01>...
"Michael" <ms*******@hotm ail.com> wrote in message
news:e7******** *************** ***@posting.goo gle.com...
Hello,

I need to search in a number column for particular "subnumbers ". For
example I have a column with 3453454 in it an I like to searh for the
number "53" in it. I know I could use

select * from table where number_column like '%53%'

but since the table is rather big I'd like to use Oracle Text for it
and query like

select * from table where contains(number _column, 53) > 0

but above query would return NULL after converting the number column
to a varchar2 column! Only full numbers are indexed and therefore only
a search on the full number 3453454 would yield a result. What are my
options to make above query with "contains" clause work?

Thanks in advance

Oracle text won't help since Oracle Text is looking for words not
substrings. I can't think of a Mathmatical transformation that would then use an index on the column. Is it always 53 or could it be any substring? If it was always 53 then you could have a function based index. I think you are going to have to do:
select * from table where to_char(number_ column) like '%53%' and have to do a full table scan.
Jim


Thanks for your prompt reply.

it could be any substring, thats why I need sth.like above query

select * from table where contains(number _column, '234') > 0

there must be a (better) solution to avoid the full table scan. Any
other opinions,sugges tions?

Thanks, Michael


Think about it. How would one index a number (even represented as a string)
to be able to quickly search for any matching substring? (Your use of
contains as an example isn't how contains works. It is contains in a
document or string of characters delimited by spaces. 12345 isn't delimited
by spaces to search for 234 so nothing would be returned.) If this isn't
an OLTP system and if you have a limited number of decimal places (eg all
numbers are less than 1 million) then you could split the number into
seperate columns and use a bitmapped index on each column. Like:

myNumberCol Hundred1000s ten1000s thousands hundreds tens ones
12345 0 1 2
3 4 5
543215 5 4 3
2 1 5

then the select would be
select * from mytable where (Hundred1000s=' 2' and ten1000s='3' and thousands
='4') or
(ten1000s='2' and thousands='3'
and hundreds ='4') or
(thousands='2' and hundreds
='3' and tens ='4') or
(hundreds ='2' and tens ='3'
and ones='4')

Using a bitmapped index would be fast. (only 10 values in a column and it
can and them together) But don't do it in an oltp environment.
Jim


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5230
by: Jan Bols | last post by:
I've been trying to install Oracle 8.1.7 on a fresh Mandrake 9.1 O.S for days, but I'm still not able to get it running. I've tried several install instructions that I found on the internet but no luck yet. Here is a short description of what I did so far: 1. I installed the jdk118_v3-glibc-2.1.3.tar in the /usr/local/ dir and made a symbolic link from /usr/local/java to this 2. I installed all the necessary groups and users (oracle,...
133
9098
by: jonathan | last post by:
hey all, I realize that this question might pop up from time to time, but I haven't seen it a while and things might of changed, so - Right now (July 2004) how does mysql stand up in comparison to oracle? We are seriously considering migrating our multi-processor oracle system to mysql to save on licensing costs, and would need several features that mysql may or may not have:
3
23463
by: Jon Ole Hedne | last post by:
My Access 2002-application need to work with tables from both Oracle and Access. To solve this, I want to run some querys on three views in Oracle and import the results into temporary Access-tables. I have tried this: conn.Provider = "Microsoft.Jet.OLEDB.4.0" conn.ConnectionString = "data source=" & datafil & ";Jet OLEDB:Database Password=" conn.Open datafil
1
9207
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this will work for 9i and even 10g ) No one had what I needed, so I wrote it myself. I Rule. This code isn't going for efficiency, and isn't trying to be dynamic. It doesn't create the table structure in Oracle, that's up to you. (I
6
3953
by: robin9876 | last post by:
In an Access 97 (and 2000) database that has linked tables to Oracle which is showing some fields as text when they are numbers in Oracle. In Oracle they are specified to a size e.g. Number(38). This is causing some issues when trying join different tables in a query. How can the correct datatype be defined in Access?
56
4976
by: Ashish Patankar | last post by:
I want to migrate my Oracle 10g database to Db2. I want some documentation for the comparision between these to databases. I also want to know which features of Oracle 10g are supported by Db2 and which are not supported.
5
7247
by: jonceramic | last post by:
Hi All, I started developing in Access, and people took notice and so we're starting to migrate into our corporate's bigger Oracle system. I'll still be using my developed Access front ends, but will be migrating my back ends to Oracle ODBC. 1. Does anyone have recommendations for books or web resources for general rules/guidelines/help on doing this? I haven't found a good
2
14255
by: Vinod Sadanandan | last post by:
All, Below listed are the new features in Oracle 11g ,please join me in this discussion to generate a testcase and analyze each of the listed features . Precompilers: Additional Array INSERT and SELECT Syntax Support by Pro*C/C++ and Pro*COBOL Precompilers: Dynamic SQL Statement Caching in Pro*C/C++ and Pro*COBOL Precompilers: Fix Execution Plan in Pro*C/C++ and Pro*COBOL Precompilers: Flexible B Area Length...
3
962
by: Michael | last post by:
Hello, I need to search in a number column for particular "subnumbers". For example I have a column with 3453454 in it an I like to searh for the number "53" in it. I know I could use select * from table where number_column like '%53%' but since the table is rather big I'd like to use Oracle Text for it and query like
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.