Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: String Manipulation

Re: String Manipulation

From: Jeremiah Wilton <jeremiah_at_ora-600.net>
Date: Thu, 17 May 2007 12:06:02 -0700
Message-ID: <464CA79A.9020802@ora-600.net>


A regex returning the first word from the address should do it:

SQL> select regexp_substr('foo.bar.baz','\w*') from dual;

REG

---
foo

Seems more elegant than all the instr(substr(instr()) stuff.  I haven't 
thought through if there are any non-word (\w) characters that could 
potentially be in a DNS name.
--
Jeremiah Wilton
ORA-600 Consulting
http://www.ora-600.net

Shivaswamy Raghunath wrote:


> I need to get "instance" from ('instance.company.com
> <http://instance.company.com>') on SQLPLUS. How I can do this?
-- http://www.freelists.org/webpage/oracle-l
Received on Thu May 17 2007 - 14:06:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US