Nested methods

jda jda at his.com
Sun Jul 17 18:17:18 CDT 2005


>Here is a prototype that works:
>
>"IF(LOCATE('The ', title)=1, RIGHT(title, LENGTH(title) - 
>LENGTH('The ')), title)")
>
>I see two issues:
>
>1. How do I nest recursively the tests for each word? There might be 
>dozens (for different languages).
>
>2. Can I BREAK if there is a match? Once there is a hit I want the 
>method to just return the modified title without going through the 
>rest of the list of words (if another banned first word were next, 
>it would be deleted too, which I would NOT want).
>

Followup:

I thought perhaps the SELECT CASE statement might do what I'm looking 
for. Here's a query that looks like it should work, but returns 
nothing. Any ideas?

SELECT CASE WHEN
     LOCATE('The ',title)=1 THEN RIGHT(title, LENGTH(title) - LENGTH('The '))
ELSE
     WHEN LOCATE('An ',title)=1 THEN RIGHT(title, LENGTH(title) - LENGTH('An '))
ELSE
     WHEN LOCATE('A ',title)=1 THEN RIGHT(title, LENGTH(title) - LENGTH('A '))
ELSE
     title


Thanks,

Jon


More information about the Valentina mailing list