Re: String Manipulation

  • From: Jeremiah Wilton <jeremiah@xxxxxxxxxxx>
  • To: shivaswamykr@xxxxxxxxx
  • Date: Thu, 17 May 2007 12:06:02 -0700

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?
--
//www.freelists.org/webpage/oracle-l


Other related posts: