I am using Oracle9iR2 / JDBC. I need to implement a search facility
similar to google.com on the database I have. There are 20 tables in
the database and around 30000 records in total. I have to search only
in VARCHAR2 and CLOB fields. Each table has an ID (PK) column. How to
write a single query that search these tables for given string.
Here is a sample for quick understanding.. .
............... ............... ..............
CREATE TABLE A (ID NUMBER, TITLE VARCHAR2(200), DESCRIPTION CLOB);
CREATE TABLE B (ID NUMBER, TITLE VARCHAR2(200), DESCRIPTION CLOB,
NOTES VARCHAR2(500));
INSERT INTO A VALUES(101, 'Best online shop', 'Amazon.com is one of
the best online book store');
INSERT INTO A VALUES(102, 'Movie of the week', 'Beautiful Mind
featuring...');
INSERT INTO B VALUES(201, 'Page available', 'The page is currently
unavailable', 'no notes');
INSERT INTO B VALUES(202, 'Address bar', 'type the page address in the
Address bar', 'store');
Here is what I am trying... (Please correct)
............... ............... ..............
SELECT ID, TEXT
FROM (SELECT ID, (TITLE || ' ' || DESCRIPTION) TEXT
FROM A
WHERE UPPER(TITLE) LIKE UPPER('%store%' )
OR UPPER(DESCRIPTI ON) LIKE UPPER('%store%' )
)
UNION
SELECT ID, TEXT
FROM (SELECT ID, (TITLE || ' ' || DESCRIPTION || ' ' || NOTES) TEXT
FROM B
WHERE UPPER(TITLE) LIKE UPPER('%store%' )
OR UPPER(DESCRIPTI ON) LIKE UPPER('%store%' )
OR UPPER(NOTES) LIKE UPPER('%store%' )
)
When I run the individual part of above query it runs fine but after
UNION it gives
SELECT ID, TEXT
*
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected - got CLOB
How to solve the problem. ****OR*** Please suggest RIGHT way of doing
the search (similar to google).
Thanks 1 6170
Hi
Do the following
1)Please go to tahiti.oracle.c om
2)register yourself registration is free
3)serach for intermedia.or oracle text
this is exactly what your looking for.
regards
Hrishy This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: bissatch |
last post by:
Hi,
I would like to add a search engine facility onto my website. This way,
if anybody uses it to search my site they will be presented with a page
of results where their search query matched that contained within the
page's text.
I have done something like this for news articles but these are
articles that are stored within a database so a simple SQL query would
do. For this it would actually need to search the HTML page (ie.
|
by: bissatch |
last post by:
Hi,
I am aware that Google provides a search function for websites. What I
want is possibly an xml file that contains search results of my site
where I can provide the design interface consistant with the site
rather than the Google look.
Does Google provide this feature? Where can I learn more? I tried
searching on Google but wasnt sure what to look for. Would this be
free? I can understand why Google would want to charge for this...
|
by: George |
last post by:
Hi,
Anyone has the background for explaining?
I have made a search on my name and I have got a link to another
search engine.
The link's title was the search phrase for the other search engine (a
wicked phrase). Some but not all of the words of that phrase exist in
my website.
I reported it and they removed the link but did not give explanations.
|
by: Noticedtrends |
last post by:
Can inference search-engines narrow-down the number of often irrelevant
results, by using specific keywords; for the purpose of discerning
emerging social & business trends?
For example, if authors of content subconsciously mention the keywords
"lately and noticed" within the same brief sentence, the reader may
infer "an unintended message" through the process of "inferential
scanning;" a method of noting "semantic anomalies" which may...
|
by: Mark Kamoski |
last post by:
Hi--
Please help.
How can one implement a simple site search for an ASP.NET site that
consists of ASPX and ASCX content pages?
I have a small site (of less than 100 content pages). The content pages are
of type ASPX and ASCX.
| |
by: Ben Fidge |
last post by:
Hi
I'm working on a site which requires the users to specify a hotel at which
they're staying in London. The complete list of hotels comes to something
like 1600 records. Each record consists of Hotel Name, Street Address and
Postcode.
We need to make it as simple as possible for users to pick their hotel, but
I don't want to put 1600 hotel names in a drop-down list, and we have to
consider the fact that not every user is going to...
|
by: Pieter |
last post by:
Hi,
I have my own custom BindingList, that inherits from BindingList, and
implements IComponent.
I would like to implement a Find-method, that will allow me to search for a
property of my Items.
So basicly: If my Items in the List have a property Name, I would like to be
able to return with this method all the items that have Name = 'Bill Gates'
etc.
|
by: Michael Fesser |
last post by:
..oO(Jerry Stuckle)
I prefer third-party search engines or my own. A simple index-based
engine with ranking is not that hard to write. Of course it's not that
powerful than a professional engine, but usually enough to start with.
A while ago I used the Google Search via their SOAP API - it was a pain.
The results where often not up-to-date, the response from the server was
slow and the API allowed only to get up to 10 search results...
|
by: javaq |
last post by:
I am using Oracle9iR2 / JDBC. I need to implement a search facility
similar to google.com on the database I have. There are 20 tables in
the database and around 30000 records in total. I have to search only
in VARCHAR2 and CLOB fields. Each table has an ID (PK) column. How to
write a single query that search these tables for given string.
Here is a sample for quick understanding...
............................................
CREATE...
|
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,...
|
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...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |