Home » SQL & PL/SQL » SQL & PL/SQL » Comparing strings in Oracle
Comparing strings in Oracle [message #270843] Fri, 28 September 2007 02:42 Go to next message
drimades
Messages: 13
Registered: June 2007
Junior Member
I have a field Website in the db table Authors declared as httpuritype. I need to compare the text within <title> ... </title> tag of that field with another field of a db table Works and select the records that have any word that appears within the tag <title> of the former field Website.

So if in the tag <title> there is the string "have a nice day" and in the field of the other table the string "a good day for a walk" it will return the record because they have any words matching. Any idea?
Re: Comparing strings in Oracle [message #270862 is a reply to message #270843] Fri, 28 September 2007 03:35 Go to previous messageGo to next message
Maaher
Messages: 7054
Registered: December 2001
Senior Member
This seems like something for Oracle Text. Does this help?

MHE
Re: Comparing strings in Oracle [message #270929 is a reply to message #270843] Fri, 28 September 2007 07:41 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
In addition to oracle text, there are also some built in functions for dealing with xml data. I'd have to look them up, because so far I've managed to avoid xml completely, but these functions let you specify tag names and extract text that falls between them...xml elements. You don't have to manually parse it or anything is my point, in order to get your search string.
Re: Comparing strings in Oracle [message #271158 is a reply to message #270843] Sun, 30 September 2007 04:15 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Look at ExtractValue Function.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions052.htm#i1131042
Re: Comparing strings in Oracle [message #285106 is a reply to message #271158] Mon, 03 December 2007 08:52 Go to previous message
drimades
Messages: 13
Registered: June 2007
Junior Member
DECLARE
2 content CLOB;
3 uri httpuritype;
4 BEGIN
5 uri := httpuritype.createUri('http://www.google.com');
6 content := uri.getClob();
7 END;


the field of the table authors in this case is uri and is declared as httpuritype

how can I use HTML_SECTION_GROUP or something similar to section the html text that I have in content in the sections TITLE, HEADING, BODY, etc. so to perform CONTAINS queries like ... WHERE CONTAINS(TITLE, StringToFind) etc.?

[Updated on: Mon, 03 December 2007 08:52]

Report message to a moderator

Previous Topic: Packege
Next Topic: procedure executing and data not getting processed
Goto Forum:
  


Current Time: Thu Oct 23 10:50:45 CDT 2014

Total time taken to generate the page: 0.09006 seconds