IntelliJ Java IDE
The moose likes Oracle/OAS and the fly likes substr in oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Reply Bookmark "substr in oracle" Watch "substr in oracle" New topic
Author

substr in oracle

Vallaru smitha
Ranch Hand

Joined: Aug 19, 2008
Posts: 87

Hi,

xyz@yahoo.com

Can anyone please help to extract yahoo from above string.

Thanks
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 177
You can use a combination of substr and instr. Something like this.

But you may need to improve to handle repeating '.'
Christophe Verré
Marshal

Joined: Nov 24, 2005
Posts: 14361

Note that Oracle supports regular expressions (REGEXP_LIKE), so if you can come up with a regular expression to extract that part, you'll probably be able to use it with Oracle.


[SCBCD Wall of Fame] [My Blog]
All roads lead to JavaRanch
Help Japan. Make a donation.
 
 
subject: substr in oracle
 
Threads others viewed
design the Java swing with dynamic creation of JTextfield,JLabel,Jcombobox
SCJP 1.5 review - not a so good test?
TOMCAT Environmental Variables
Weird error
NX: Reading from the DB
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com