Home » SQL & PL/SQL » SQL & PL/SQL » how can we find characters in string without using substr?
how can we find characters in string without using substr? [message #249568] Thu, 05 July 2007 01:17 Go to next message
rahul_bahulekar
Messages: 18
Registered: January 2007
Junior Member
how can we find characters in string without using substr?

eg. 'asdfg', i want to find 'd' without using substr.
Re: how can we find characters in string without using substr? [message #249574 is a reply to message #249568] Thu, 05 July 2007 01:43 Go to previous messageGo to next message
diku
Messages: 23
Registered: April 2007
Junior Member
Apologies if I am jumping the gun.
But why would you hve such a requirement?

If you must, a PL/SQl function can be developed but as again WHY
Re: how can we find characters in string without using substr? [message #249576 is a reply to message #249568] Thu, 05 July 2007 01:48 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
In addition to diku's remark:
why would you use substr if you want to find an occurrence of a character in a string?

This smells like homework, so try to do some yourself first.
Re: how can we find characters in string without using substr? [message #249686 is a reply to message #249576] Thu, 05 July 2007 09:55 Go to previous messageGo to next message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
"I have to drive my car to location X without using a steering-wheel, please help!"

(sorry, couldn't resist)
Re: how can we find characters in string without using substr? [message #249692 is a reply to message #249568] Thu, 05 July 2007 10:01 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
A hint,
Check out oracle functions starting with "I"
Re: how can we find characters in string without using substr? [message #249811 is a reply to message #249686] Fri, 06 July 2007 00:06 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
skooman wrote on Thu, 05 July 2007 16:55
"I have to drive my car to location X without using a steering-wheel, please help!"

(sorry, couldn't resist)

Not quite the analogy..

"I have to drive my car to location X without a rudder" would be more apropriate!
The OP is looking for the location of a character in a string. SUBSTR is (more or less) useless for that anyway, unless you really want to take the long way
Re: how can we find characters in string without using substr? [message #249835 is a reply to message #249568] Fri, 06 July 2007 01:56 Go to previous messageGo to next message
rahul_bahulekar
Messages: 18
Registered: January 2007
Junior Member

its a homework i want to do for R&D purpose....!!!

so i though i will get some hint to workout this, thats why i posted the topic...but the reply from skooman (senior member) is quite strange....!!!

anyways...!!!

i will drop the update once i am done with this...
Re: how can we find characters in string without using substr? [message #249837 is a reply to message #249568] Fri, 06 July 2007 02:13 Go to previous messageGo to next message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
For R&D purpose you should definitely get familiar with Oracle documentation, found eg. online on http://tahiti.oracle.com/.

In this case, choose SQL Reference.
Chapter 5 Functions
SQL Functions
Single-Row Functions
Character Functions Returning Number Values
Re: how can we find characters in string without using substr? [message #249880 is a reply to message #249835] Fri, 06 July 2007 07:05 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
rahul_bahulekar wrote on Fri, 06 July 2007 08:56

its a homework i want to do for R&D purpose....!!!

Doing R&D is not asking in a forum how to do something. Doing R&D is searching for documentation and trying yourself.
Previous Topic: How to UPDATE a table column from another table value?
Next Topic: Clarification on 'N' th row
Goto Forum:
  


Current Time: Sun Dec 11 08:11:31 CST 2016

Total time taken to generate the page: 0.11931 seconds