Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Question about Ltrim

682150Apr 19 2009 — edited Apr 19 2009
I am a student in an Oracle SQL class. 10g.
We recently studied Single-Row Functions
One of the functions was LTRIM.
I'm (along with most of the people in the class) a little confused about something.
Our book says that LTRIM is 'LTRIM(c, s) where c represents the data to be affected
and s represents the string to be removed from the left of the data'.
An example is this:
Ltrim('P.O. BOX 123','P.O.') would strip the string 'P.O.' off the front and leave
us with ' BOX 123'. Which is exactly what it does.
But what we found is that
Ltrim('P.O. BOX 123','.OZP') does exactly the same thing.
The order of the characters doesn't seem to matter.
And all of the characters don't need to be present.
To us a 'string' meant a contiguous set of characters in a set order.
However, it looks like in this case string for Ltrim means something more
like 'any of the characters in this set of characters'.

I'm wondering if someone might be able to clarify how LTRIM is working.

Thanks!
This post has been answered by Walter Fernández on Apr 19 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2009
Added on Apr 19 2009
6 comments
418 views