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

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Tue Nov 17 02:25:08 CST 2009


Touché? ;)

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Tuesday, November 17, 2009 5:27 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] SPAM-LOW: Replace multiple spaces with a single space

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>
> 
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4613 (20091116) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru
 





More information about the AccessD mailing list