dbTalk Databases Forums  

SUBSTR & INSTR

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss SUBSTR & INSTR in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mtek
 
Posts: n/a

Default SUBSTR & INSTR - 06-16-2008 , 11:48 AM







Hi,

I'm looking to parse an email. Say I have an email like this:

johnjones (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjones (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjones (AT) amail (DOT) co

The same, I basically want jjones (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John

Reply With Quote
  #2  
Old   
joel garry
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:01 PM






On Jun 16, 9:48*am, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

I'm looking to parse an email. *Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John
Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html


Reply With Quote
  #3  
Old   
joel garry
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:01 PM



On Jun 16, 9:48*am, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

I'm looking to parse an email. *Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John
Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html


Reply With Quote
  #4  
Old   
joel garry
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:01 PM



On Jun 16, 9:48*am, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

I'm looking to parse an email. *Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John
Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html


Reply With Quote
  #5  
Old   
joel garry
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:01 PM



On Jun 16, 9:48*am, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

I'm looking to parse an email. *Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John
Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html


Reply With Quote
  #6  
Old   
Mtek
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:25 PM



On Jun 16, 12:01 pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Jun 16, 9:48 am, Mtek <m... (AT) mtekusa (DOT) com> wrote:



Hi,

I'm looking to parse an email. Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John

Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html
Thanks a bunch. Was unaware that Oracle offered a reverse INSTR
lookup.....


Reply With Quote
  #7  
Old   
Mtek
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:25 PM



On Jun 16, 12:01 pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Jun 16, 9:48 am, Mtek <m... (AT) mtekusa (DOT) com> wrote:



Hi,

I'm looking to parse an email. Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John

Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html
Thanks a bunch. Was unaware that Oracle offered a reverse INSTR
lookup.....


Reply With Quote
  #8  
Old   
Mtek
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:25 PM



On Jun 16, 12:01 pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Jun 16, 9:48 am, Mtek <m... (AT) mtekusa (DOT) com> wrote:



Hi,

I'm looking to parse an email. Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John

Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html
Thanks a bunch. Was unaware that Oracle offered a reverse INSTR
lookup.....


Reply With Quote
  #9  
Old   
Mtek
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 12:25 PM



On Jun 16, 12:01 pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Jun 16, 9:48 am, Mtek <m... (AT) mtekusa (DOT) com> wrote:



Hi,

I'm looking to parse an email. Say I have an email like this:

johnjo... (AT) gmail (DOT) abc.def.ghi.com

I basically want johnjo... (AT) gmail (DOT) abc.def.ghi in one variable and
the .com in the other.

If the email is this:

jjo... (AT) amail (DOT) co

The same, I basically want jjo... (AT) amail (DOT) co in one variable and
the .com in the other.

I know I have to use SUBSTR & INSTR, but the problem is that I do not
know how many periods may be in the email address.....

Any takers for some help??

Thanks!

John

Can you not just check whatever is after the last period and decide
then? There are only so many domains in the world. See the docs on
instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have
a .com, so I guess I'm thankful you can't spam me! :-)

jg
--
@home.com is bogus.
Sorry, not drunk enough: http://www.signonsandiego.com/uniont...b14lerach.html
Thanks a bunch. Was unaware that Oracle offered a reverse INSTR
lookup.....


Reply With Quote
  #10  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: SUBSTR & INSTR - 06-16-2008 , 03:35 PM



On Mon, 16 Jun 2008 10:25:13 -0700 (PDT), Mtek <mtek (AT) mtekusa (DOT) com>
wrote:

Quote:
Thanks a bunch. Was unaware that Oracle offered a reverse INSTR
lookup.....
Not surprisingly. Most questions here and on OTN are redundant, while
doc questions.
Most people don't read docs before posting, and continue not to read
them after being pointed to the docs.

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.