String Parsing
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: String Parsing

  1. #1
    Join Date
    Sep 2000
    Location
    VA
    Posts
    343
    Hi all,

    I have a string which I need to parse out and find the position of the first integer in it, like to parse out 'ATM3/0/0' into 'ATM' and '3/0/0'. Does anyone know an easy way of doing it??

    Shiva.

  2. #2
    Join Date
    Oct 2000
    Posts
    90
    something like this works

    select SUBSTR('ATM3/0/0', 1, INSTR(TRANSLATE('ATM3/0/0', '0123456789', '^^^^^^^^^^'), '^') - 1),
    SUBSTR('ATM3/0/0', INSTR(TRANSLATE('ATM3/0/0', '0123456789', '^^^^^^^^^^'), '^'))
    from dual

    the ^ character I have used is any character that is definately not going to be in the string you pass it.

    Mike

  3. #3
    Join Date
    Sep 2000
    Location
    VA
    Posts
    343
    Thanks a lot Mike.
    It works like charm.

    Shiva.

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