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.

str_replace

5 posts in Product Futures Discussion Last posting was on 2003-09-26 17:56:21.0Z
PhilipL Posted on 2003-09-26 16:33:17.0Z
Sender: 3f01.3f7469b6.1804289383@sybase.com
From: PhilipL
Newsgroups: sybase.public.ase.product_futures_discussion
Subject: str_replace
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3f746a4d.3f12.846930886@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 26 Sep 2003 09:33:17 -0700
X-Trace: forums-1-dub 1064593997 10.22.241.41 (26 Sep 2003 09:33:17 -0700)
X-Original-Trace: 26 Sep 2003 09:33:17 -0700, 10.22.241.41
Lines: 9
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1395
Article PK: 96402

I want to replace a string with nothing. For example:

select str_replace("yyyyyyXXXzzzzz","XXX","")

results in: yyyyyy zzzzz

Why not this? yyyyyyzzzzz

Thanks.


Bret Halford Posted on 2003-09-26 17:02:30.0Z
Message-ID: <3F74701B.5C4FE1F5@sybase.com>
From: Bret Halford <bret@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U)
X-Accept-Language: en,ja
MIME-Version: 1.0
Newsgroups: sybase.public.ase.product_futures_discussion
Subject: Re: str_replace
References: <3f746a4d.3f12.846930886@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: bret-pc2.sybase.com
X-Original-Trace: 26 Sep 2003 10:05:08 -0700, bret-pc2.sybase.com
Lines: 19
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 26 Sep 2003 09:58:05 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 26 Sep 2003 10:02:30 -0700
X-Trace: forums-1-dub 1064595750 10.22.108.75 (26 Sep 2003 10:02:30 -0700)
X-Original-Trace: 26 Sep 2003 10:02:30 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1396
Article PK: 96403

Because ASE currently has no concept of an empty string. An empty
string
stored in a varchar type becomes a single space, per Ref Manual
Vol 1 section on varchar.

-bret

PhilipL wrote:
>
> I want to replace a string with nothing. For example:
>
> select str_replace("yyyyyyXXXzzzzz","XXX","")
>
> results in: yyyyyy zzzzz
>
> Why not this? yyyyyyzzzzz
>
> Thanks.


PhilipL Posted on 2003-09-26 17:19:58.0Z
Sender: 1963.3f7475a4.1804289383@sybase.com
From: PhilipL
Newsgroups: sybase.public.ase.product_futures_discussion
Subject: Re: str_replace
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3f7475da.196c.846930886@sybase.com>
References: <3f746a4d.3f12.846930886@sybase.com><3F74701B.5C4FE1F5@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 26 Sep 2003 10:22:34 -0700, 10.22.241.42
Lines: 21
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 26 Sep 2003 10:15:31 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 26 Sep 2003 10:19:58 -0700
X-Trace: forums-1-dub 1064596798 10.22.108.75 (26 Sep 2003 10:19:58 -0700)
X-Original-Trace: 26 Sep 2003 10:19:58 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1397
Article PK: 96406

Thanks Bret.

> Because ASE currently has no concept of an empty string.
> An empty string
> stored in a varchar type becomes a single space, per Ref
> Manual Vol 1 section on varchar.
>
> -bret
>
>
> PhilipL wrote:
> >
> > I want to replace a string with nothing. For example:
> >
> > select str_replace("yyyyyyXXXzzzzz","XXX","")
> >
> > results in: yyyyyy zzzzz
> >
> > Why not this? yyyyyyzzzzz
> >
> > Thanks.


Rob Verschoor Posted on 2003-09-26 17:32:47.0Z
From: "Rob Verschoor" <rob@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
Newsgroups: sybase.public.ase.product_futures_discussion
References: <3f746a4d.3f12.846930886@sybase.com>
Subject: Re: str_replace
Lines: 35
MIME-Version: 1.0
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: a66246.upc-a.chello.nl
X-Original-NNTP-Posting-Host: a66246.upc-a.chello.nl
Message-ID: <3f74783f@forums-1-dub>
Date: 26 Sep 2003 10:32:47 -0700
X-Trace: forums-1-dub 1064597567 62.163.66.246 (26 Sep 2003 10:32:47 -0700)
X-Original-Trace: 26 Sep 2003 10:32:47 -0700, a66246.upc-a.chello.nl
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1398
Article PK: 96405


<PhilipL> wrote in message news:3f746a4d.3f12.846930886@sybase.com...
> I want to replace a string with nothing. For example:
>
> select str_replace("yyyyyyXXXzzzzz","XXX","")
>
> results in: yyyyyy zzzzz
>
> Why not this? yyyyyyzzzzz
>
> Thanks.

In 12.5.1 (currently in beta), you can specify NULL as the third
parameter, which will cut the original string from the source string.
In 12.5.0.3, specifying NULL doesn't work (it renders the entire
result starting NULL as well).

HTH,

Rob
-------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5

Author of "Tips, Tricks & Recipes for Sybase ASE" and
"The Complete Sybase ASE Quick Reference Guide"
Online orders accepted at http://www.sypron.nl/shop

mailto:rob@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------


Kiriakos Georgiou Posted on 2003-09-26 17:56:21.0Z
Reply-To: "Kiriakos Georgiou" <kiriakos.georgiou@nrl.navy.mil>
From: "Kiriakos Georgiou" <spam@block>
Newsgroups: sybase.public.ase.product_futures_discussion
References: <3f746a4d.3f12.846930886@sybase.com> <3f74783f@forums-1-dub>
Subject: Re: str_replace
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4927.1200
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
NNTP-Posting-Host: lib-064.nrl.navy.mil
X-Original-NNTP-Posting-Host: lib-064.nrl.navy.mil
Message-ID: <3f747dc5$2@forums-1-dub>
Date: 26 Sep 2003 10:56:21 -0700
X-Trace: forums-1-dub 1064598981 132.250.186.64 (26 Sep 2003 10:56:21 -0700)
X-Original-Trace: 26 Sep 2003 10:56:21 -0700, lib-064.nrl.navy.mil
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1399
Article PK: 96404

Like stuff().

-K

"Rob Verschoor" <rob@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY> wrote in
message news:3f74783f@forums-1-dub...
> <PhilipL> wrote in message news:3f746a4d.3f12.846930886@sybase.com...
> > I want to replace a string with nothing. For example:
> >
> > select str_replace("yyyyyyXXXzzzzz","XXX","")
> >
> > results in: yyyyyy zzzzz
> >
> > Why not this? yyyyyyzzzzz
> >
> > Thanks.
>
>
> In 12.5.1 (currently in beta), you can specify NULL as the third
> parameter, which will cut the original string from the source string.
> In 12.5.0.3, specifying NULL doesn't work (it renders the entire
> result starting NULL as well).
>
> HTH,
>
> Rob
> -------------------------------------------------------------
> Rob Verschoor
>
> Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
> and Replication Server 12.5
>
> Author of "Tips, Tricks & Recipes for Sybase ASE" and
> "The Complete Sybase ASE Quick Reference Guide"
> Online orders accepted at http://www.sypron.nl/shop
>
> mailto:rob@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY
> http://www.sypron.nl
> Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
> -------------------------------------------------------------
>