[AccessD] SPAM-LOW: Replace multiple spaces with a single space

jwcolby jwcolby at colbyconsulting.com
Mon Nov 16 20:27:18 CST 2009


ROTFLMAO.  No Stuart, YOU missed the whole point of the article.  Look closely at the bottom of the 
article and you will see he is proselytizing getting rid of cursors.

All there are are rows.  You think a table isn't "row by agonizing row"?  What, do you think it 
updates every row simultaneously?  This operation applies the set of (hmmm... functions?) to one 
field of one ROW, then does the same field of the next ROW, and so forth ad nauseam until it 
finishes all of the ROWS in the result set.

Let me see, it calls...

	Replace (a function)
		(Replace (a function)
			(Replace (a function)
				(LTrim (a function)
					(RTrim (a function)
				Char(A function)
			Char(A function)
		Char(a function)

So... let's count here...

I count EIGHT functions in this little doosey.  And you are raising cain about my wrapping that in 
one more function to make it universal???????

Yes there is an overhead to calling a function but inside of that function it is performing the same 
operation.  OTOH you can now apply my udf to update / process any field in any table instead of 
trying to remember ... where the heck was that tip again.

If you don't want to use UDF, then store the tip wherever you store such things.  I will store it in 
my UDF, thank you very much!  Notice that I also provided a pointer to the article in my UDF so I 
can get back there.

John W. Colby
www.ColbyConsulting.com


Stuart McLachlan wrote:
> You missed the whole point of the article.  The prupose of the method is to use the 
> efficiency of Set based operations.
> 
> <quote>
> The truth is that you don't need the RBAR of a User Defined Function at all.
> This article explains the "puzzle solving" behind a common set based method 
> ...
> Remember the goal is to convert all of those sets of spaces to just a single space without 
> the use of RBAR even if the RBAR is through the simple use of a UDF.
> ...
> "RBAR" is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
> </unquote>
> 



More information about the AccessD mailing list