Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!in.100proofnews.com!in.100proofnews.com!newsfeed.media.kyoto-u.ac.jp!headwall.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: ewong@mail.com (Ed Wong)
Newsgroups: comp.databases.oracle.server
Subject: LTRIM bug?
Date: 8 Aug 2003 12:16:59 -0700
Organization: http://groups.google.com/
Lines: 23
Message-ID: <a5ae1554.0308081116.46fe84ee@posting.google.com>
NNTP-Posting-Host: 65.209.203.254
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1060370220 15318 127.0.0.1 (8 Aug 2003 19:17:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 8 Aug 2003 19:17:00 GMT
Xref: newssvr20.news.prodigy.com comp.databases.oracle.server:240121

I am using a ltrim function and experiencing a weird result.  I am
trying to cut off a string 'COMPANY-' on the left side but I got
different results with different texts (see below).  The 2nd query
result is incorrect as the 'C' is missing.  It seems to me that if the
first character after trim is the same as the first character before
trims, Oracle cut the first character off the resulting string. 
Anyone experiencing this problem?  I am on 8.1.7.2.0 EE Sun Solaris
2.8.

SQL> select ltrim('COMPANY-JOHN','COMPANY-') from dual;

LTRI
----
JOHN

SQL> select ltrim('COMPANY-CHARLIE','COMPANY-') from dual;

LTRIM(
------
HARLIE

Thanks,
ewong
