Re: Question about replace and _tally
From: John Germany (nospamoglethorpesupply_at_earthlink.net1)
Date: 07/05/04
- Next message: Ferg: "Re: winzip & CHR(133)"
- Previous message: Gene Wirchenko: "Re: Question about replace and _tally"
- In reply to: Jim: "Question about replace and _tally"
- Next in thread: Jack Jackson: "Re: Question about replace and _tally"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 5 Jul 2004 18:41:48 -0400
_tally returns the number of records actually processed.
I tried,
replace all MyField with iif(MyField = "find me","replace with me",MyField)
but it also returns the totat reccount.
It seems if you do not use a function in the replace clause it returns the
correct amount of records affected. I'll leave this one to someone else!
try
replace all MyFied with "replace with me" for myfield = "find me"
? _tally
John.
"Jim" <DontEvenBother@hotmail.com> wrote in message
news:bd431690.0407051241.13cb4605@posting.google.com...
> Greetings!
>
> I am trying to obtain the number of records modified by the REPLACE
> command using _TALLY, but I am getting unexpected results.
>
> My command is: REPLACE ALL MyField WITH STRTRAN("find me", "replace
> with me")
>
> Unfortunately, _TALLY returns a number equal to the total number of
> records in the table regardless of how many meet the condition
> setforth in the STRTRAN function.
>
> It doesn't seem logical that an iteration would be counted when the
> condition is not met and thus nothing really gets replaced.
>
> Is this by default -- i.e. _TALLY simply counts the total number of
> attempts? Is the only condition that would force _TALLY to skip
> counting records one that follows a FOR clause?
>
> For example, I can reword the command as follows:
> REPLACE MyField WITH STRTRAN("find me", "replace with me") FOR "find
> me" $ MyField
>
> But that seems redundant and probably slower. Is that the only way?
> Any other insight would be appreciated.
>
> Thanks,
> Jim
- Next message: Ferg: "Re: winzip & CHR(133)"
- Previous message: Gene Wirchenko: "Re: Question about replace and _tally"
- In reply to: Jim: "Question about replace and _tally"
- Next in thread: Jack Jackson: "Re: Question about replace and _tally"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|