[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Uppercasing Initial characters.
- Subject: Re: Uppercasing Initial characters.
- From: "Wells, Wade" <wade.wells@LMCO.COM>
- Date: Thu, 6 May 1999 11:43:14 -0400
Chad,
Try using the Oracle SQL INITCAP() function:
SELECT INITCAP(namefield), INITCAP(addressfield) FROM table ...
- Wade Wells
> -----Original Message-----
> From: Chad Slattery [SMTP:Chad.Slattery@CSCLAC.IRLGOV.IE]
> Sent: Thursday, May 06, 1999 10:40 AM
> To: Multiple recipients of list SQR-USERS
> Subject: Uppercasing Initial charchters.
>
> 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