A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
substr in oracle
Joined: Aug 19, 2008
Feb 26, 2011 19:07:39
Can anyone please help to extract yahoo from above
Joined: Sep 01, 2005
Feb 28, 2011 10:29:09
You can use a combination of substr and instr. Something like this.
select substr('firstname.lastname@example.org',instr('email@example.com','@')+1,instr('firstname.lastname@example.org','.')-instr('email@example.com','@')-1) from dual
But you may need to improve to handle repeating '.'
Joined: Nov 24, 2005
Mar 01, 2011 17:40:33
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.
All roads lead to JavaRanch
It is sorta covered in the
JavaRanch Style Guide
subject: substr in oracle
TOMCAT Environmental Variables
design the Java swing with dynamic creation of JTextfield,JLabel,Jcombobox
SCJP 1.5 review - not a so good test?
NX: Reading from the DB
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014