carp,<br>
<br>
Can this code be used to change the contents of a column to all caps? If so, what is the update statement? If not, what is the code, please?<br>
<br>
Thanks.<br>
<br>
Bob
try<br>
<br>
SELECT your_select_list<br>
FROM your_table<br>
WHERE your_column >= 'A';<br>
<br>
That will pick up all rows starting with a capital letter.<br>
<br>
-ml<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= > </a><br>
I think Mike Lacey's code would prove better if dealing with large tables as, with some Relational Databases, functions like UPPER can create an additional overhead. <p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>
Without a doubt, Mike's query is far more efficient if you are looking for entries that begin with an upper case character - even more so if there is an index on the column!<br>
<br>
So it looks like the list of options is:<br>
<br>
Mike's query if you are only interested in the first character.<br>
<br>
My first query if you are interested in every character being upper case.<br>
<br>
Replace UPPER with INITCAP if you want just the first character in upper case and everything else in lower case.<br>
<br>
Replace UPPER with LOWER if you waant to find entries where all characters are lower case.<br>
<br>
Mike's approach will make use of any available indexes. Using UPPER, LOWER, or INITCAP will result in a full table scan.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.