Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Removing sections of text from MEMO fields with SQL
Fri, Oct 5 2007 11:57 AMPermanent Link

adam
I want to write a script to do something like this:

UPDATE DocumentItem
SET MainContent = REPLACE('<style>%</style>' WITH '' IN MainContent)

WHERE [some condition]

;

i.e. I have a bunch of web-pages in a table & they contain identical style-sheets embedded
in each document ... I want to remove these so I can set the styles programatically.

What I need is for DBISAM to accept wild-cards in its REPLACE function ... so that it can
delete out longer/variable sections of text.

The above syntax doesn't work. Is there another version that does?

If not, any chance of adding it to the "ToDo" ... ??

adam
Fri, Oct 5 2007 1:53 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

adam


A bit more longwinded but what about using SUBSTR and POS - almost certainly wrong but

UPDATE DocumentItem
SET MainContent = SUBSTR(MainContent,1,POS('<style>',MainContent))+SUBSTR(MainContent,POS('</style>',MainContent)+7,LENGTH(MainContent))

WHERE [some condition]

;

Roy Lambert
Mon, Oct 8 2007 11:45 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< What I need is for DBISAM to accept wild-cards in its REPLACE function
.... so that it can delete out longer/variable sections of text.

The above syntax doesn't work. Is there another version that does? >>

No, but you can add this type of functionality very easily via a custom
function.   See here:

http://www.elevatesoft.com/dbisam4d7_customizing_engine.htm

--
Tim Young
Elevate Software
www.elevatesoft.com

Image