Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Initcap function or workaround for Sybase 11.0.3.3

5 posts in ,  Upgrades and Configuration Windows NT Last posting was on 2001-03-22 06:55:22.0Z
mmsm88 Posted on 2001-03-20 21:48:09.0Z
From: mmsm88@hotmail.mom
Subject: Initcap function or workaround for Sybase 11.0.3.3
Date: Tue, 20 Mar 2001 13:48:09 -0800
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <nsjfbtglt43qgks8ec4fhbpj8kdn2f2bek@4ax.com>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 7
Newsgroups: comp.databases.sybase,sybase.public.sqlserver.nt,sybase.public.sqlserver.upgrades+configuration
NNTP-Posting-Host: penny.tagonline.com 198.138.69.45
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1059 sybase.public.sqlserver.upgrades+configuration:225
Article PK: 1085097

I have seen where oracle uses an initcap function
to convert first letter of each word to uppercase.

Is there a way to do this using Sybase 11.0.3.3?


Ivan Santhumayor Posted on 2001-03-20 22:28:48.0Z
Message-ID: <3AB804DD.63B87959@optonline.net>
From: Ivan Santhumayor <isanth@optonline.net>
X-Mailer: Mozilla 4.76 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Initcap function or workaround for Sybase 11.0.3.3
References: <nsjfbtglt43qgks8ec4fhbpj8kdn2f2bek@4ax.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 13
Date: Tue, 20 Mar 2001 22:28:48 GMT
Organization: Optimum Online
Newsgroups: comp.databases.sybase,sybase.public.sqlserver.nt,sybase.public.sqlserver.upgrades+configuration
NNTP-Posting-Host: penny.tagonline.com 198.138.69.45
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1058 sybase.public.sqlserver.upgrades+configuration:224
Article PK: 1085095

There is no function, but you can construct an equivalent function:

select stuff(<col>,1,1,upper(substring(<col>,1,1)))
from <tbl>

mmsm88@hotmail.mom wrote:

> I have seen where oracle uses an initcap function
> to convert first letter of each word to uppercase.
>
> Is there a way to do this using Sybase 11.0.3.3?


mmsm88 Posted on 2001-03-21 00:30:50.0Z
From: mmsm88@hotmail.mom
Subject: Re: Initcap function or workaround for Sybase 11.0.3.3
Date: Tue, 20 Mar 2001 16:30:50 -0800
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <kctfbtgo4c7p2pe45pur15pkj9q7jgb8hv@4ax.com>
References: <nsjfbtglt43qgks8ec4fhbpj8kdn2f2bek@4ax.com> <3AB804DD.63B87959@optonline.net>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 24
Newsgroups: comp.databases.sybase,sybase.public.sqlserver.nt,sybase.public.sqlserver.upgrades+configuration
NNTP-Posting-Host: penny.tagonline.com 198.138.69.45
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1057 sybase.public.sqlserver.upgrades+configuration:223
Article PK: 1085096

Thanks Ivan,

I have a field that contains
DUNIGAN JR., GEORGE

How would I make this work for each part of the name so that
i get Dunigan Jr., George??

On Tue, 20 Mar 2001 22:28:48 GMT, Ivan Santhumayor

<isanth@optonline.net> wrote:

>There is no function, but you can construct an equivalent function:
>
>select stuff(<col>,1,1,upper(substring(<col>,1,1)))
>from <tbl>
>
>
>mmsm88@hotmail.mom wrote:
>
>> I have seen where oracle uses an initcap function
>> to convert first letter of each word to uppercase.
>>
>> Is there a way to do this using Sybase 11.0.3.3?


Anthony Mandic <amandic Posted on 2001-03-22 06:55:22.0Z
Date: Thu, 22 Mar 2001 17:55:22 +1100
From: Anthony Mandic <amandic@*t.com.au>
Organization: Mandic Consulting Pty. Ltd.
X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Initcap function or workaround for Sybase 11.0.3.3
References: <nsjfbtglt43qgks8ec4fhbpj8kdn2f2bek@4ax.com> <3AB804DD.63B87959@optonline.net> <kctfbtgo4c7p2pe45pur15pkj9q7jgb8hv@4ax.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <#xjYI9psAHA.199@forums.sybase.com>
Newsgroups: comp.databases.sybase,sybase.public.sqlserver.nt,sybase.public.sqlserver.upgrades+configuration
Lines: 15
NNTP-Posting-Host: 210.9.51.46
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1048 sybase.public.sqlserver.upgrades+configuration:221
Article PK: 1085093


mmsm88@hotmail.mom wrote:

> I have a field that contains
> DUNIGAN JR., GEORGE
>
> How would I make this work for each part of the name so that
> i get Dunigan Jr., George??

You could use a while loop to loop thru the string.
Use the lower() function first to convert the entire string
to lower case (selecting into a temp table if you have
multiple rows), do an upper() on the first character and
then loop thru each row looking for a space or a hyphen
or apostrophe (You have to look for name like "O'Toole"
and "Brooke-Hampster" as well).

-am © 2001


Ivan Santhumayor Posted on 2001-03-21 04:17:28.0Z
Message-ID: <3AB85697.8117050@optonline.net>
From: Ivan Santhumayor <isanth@optonline.net>
X-Mailer: Mozilla 4.76 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Initcap function or workaround for Sybase 11.0.3.3
References: <nsjfbtglt43qgks8ec4fhbpj8kdn2f2bek@4ax.com> <3AB804DD.63B87959@optonline.net> <kctfbtgo4c7p2pe45pur15pkj9q7jgb8hv@4ax.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 30
Date: Wed, 21 Mar 2001 04:17:28 GMT
Organization: Optimum Online
Newsgroups: comp.databases.sybase,sybase.public.sqlserver.nt,sybase.public.sqlserver.upgrades+configuration
NNTP-Posting-Host: penny.tagonline.com 198.138.69.45
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1053 sybase.public.sqlserver.upgrades+configuration:222
Article PK: 1085094

Sorry, most of sybase functions are not global replace functions, so it
may not be possible to achieve multi-word Initcap.
System 12 does have UDF support, so a UDF is the only hope.

mmsm88@hotmail.mom wrote:

> Thanks Ivan,
>
> I have a field that contains
> DUNIGAN JR., GEORGE
>
> How would I make this work for each part of the name so that
> i get Dunigan Jr., George??
>
> On Tue, 20 Mar 2001 22:28:48 GMT, Ivan Santhumayor
> <isanth@optonline.net> wrote:
>
> >There is no function, but you can construct an equivalent function:
> >
> >select stuff(<col>,1,1,upper(substring(<col>,1,1)))
> >from <tbl>
> >
> >
> >mmsm88@hotmail.mom wrote:
> >
> >> I have seen where oracle uses an initcap function
> >> to convert first letter of each word to uppercase.
> >>
> >> Is there a way to do this using Sybase 11.0.3.3?