[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Uppercasing Initial charchters.
- Subject: Re: Uppercasing Initial charchters.
- From: Doug Cummings <dcummings@VICR.COM>
- Date: Thu, 6 May 1999 11:42:43 -0400
Chad,
If you are indeed using Oracle try using the 'initcap' function,
initcap(variable) ,when you select the variable from your table. This works in
SQLplus, embedded SQL, etc...
begin-select
initcap(a.address) &address
from employees
.....
Doug Cummings
Vicor Corp
____________________Reply Separator____________________
Subject: Uppercasing Initial charchters.
Author: Chad Slattery <Chad.Slattery@CSCLAC.IRLGOV.IE>
Date: 5/6/99 3:40 PM
Unix KSH
Oracle 6
sqr 2.5 (upgrading to NT and sqr3 soon)
Hi all,
Im taking name and address' off a table and inserting them into a mail
merge. I need to upper case the initials on each field. I have the below
procedure which will work, but does anyone have anything easier as I have
to put each field into the procedure and take it back out again?
Is there some sort of initcaps function in sqr 2.5? There doesnt seem to
be anything in the manual.
Many thanks,
Chad.
---------------------------------------------------------------------------
--------------------------------------------------
I move name to incaps as the passed in field and move it back again when it
comes out.
I do the same for all address fields.
begin-procedure init_names
let #len = length($incaps)
let #rest = #len - 1
extract $initial from $incaps 0 1
extract $rest from $incaps 1 #rest
uppercase $initial
let $incaps = $initial
lowercase $rest
let #i = 0
while #i < #rest
extract $more from $rest #i 1
if $more = ' '
concat $more with $incaps
add 1 to #i
extract $more from $rest #i 1
uppercase $more
concat $more with $incaps
else
concat $more with $incaps
end-if
add 1 to #i
end-while
end-procedure