<cfquery name="qNews" datasource="QNEWS">
select top 1 story_body,storyID
where StoryID = 4886
<cfquery name="MatchInfo" datasource="FOOTER">
<cfif FindNoCase("MatchInfo.root", qNews.story_body)>
<cfset TheStory = ReplaceNoCase(qNews.story_body, " #MatchInfo.root# ", " #qNews.story_body# ", "All")>
<cfset TheStory = qNews.story_body>
I'm attempting to parse a page of text stored in an sql database and replace certain strings with other matching words.
FOOTER is a database of a couple thousand words, each with a matching synonym. The sql 2000 database contains two rows, ROOT, and S1. ROOT is the common word and S1 is the synonym for that word.
I'm attempting to parse through the text in "qNews.story_body" but the data type is TEXT and I guess one cannot search and parse though that text?
What I need help with is making certain my query and loop would be correct if I was using VARCHAR data type, assuming I will be using a varchar data type instead of the problematic TEXT data type.
Once I get that code working correctly, I'll worry about the problem with the TEXT data type.
I can always copy the text elsewhere, temp table, hard drive, etc, and work with it. But obviously, I'd rather not. I will need some ideas where or how.
I'm using SQL 2000 and we will not upgrade so please don't ask. Other than upgrading or converting the data to VARCHAR (which I cannot because story_body is all too often larger than 8000 characters), I'll need to find a way to copy, manipulate, or otherwise get this concept to work. But let's not worry about this part until I have the code snippet I included written correctly or someone tells me my code should work as is, if I was using VARCHAR.