DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: selecting text only

  1. #1
    Join Date
    Nov 2000
    Location
    London
    Posts
    94

    selecting text only

    I have a row of data i.e ////123/hello/12/2/3/34343/2/2/2/2

    How do I select just the text back. The start position can be different aswell for different rows and also the length of the text can be different... I believe on 10g you can use REGEXP_ functions but what about 9i?

    thanks
    Last edited by rgaskell; 09-28-2006 at 11:39 AM.

  2. #2
    Join Date
    Apr 2006
    Posts
    377
    Code:
    SQL> select replace(translate('////123/hello/12/2/3/34343/2/2/2/2',
      2  	translate(upper('////123/hello/12/2/3/34343/2/2/2/2'),
      3 	'ABCDEFGHIJKLMNOPQRSTUVWXYZ',' '),' '),' ') "Only ALPHA" from dual;
    
    ONLY ALPHA
    ----------
    hello

  3. #3
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Cool


    Or just try this:
    PHP Code:
    SQLselect translate('////123/hello/12/2/3/34343/2/2/2/2',
      
    2' /0123456789',' '"Only ALPHA" from dual;
    Only
    -----
    hello 


    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  4. #4
    Join Date
    Apr 2006
    Posts
    377
    Same thing I was thinking LKBrwn_DBA. However, I wasn't sure if the OP was going to have different characters present in his data, so I just accommodated for ANYTHING but ALPHA. If you don't expect anything non-alpha besides "/" or numbers, then definitely use LKBrwn_DBA's method.

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    is it always after the 5th / but before the 6th?
    Jeff Hunter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width