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

Thread: SPLIT Question

  1. #1
    Join Date
    Feb 2002
    Posts
    3

    Unhappy

    Hi,

    I have a string like A#B#C, This string in the PL/SQL block, I want to split where the # sign and return the 3 values from my procedure OUT parameters.

    I am poor in the SQL, If any one know how to split this string to 3 different varaible, plase let me know.

    I want something like this:
    StrABC = A#B#C

    StrA = A
    StrB = B
    StrC = C

    Thanks in advance,
    Raju
    Raju

  2. #2
    Join Date
    Feb 2002
    Posts
    3
    Never Mind,

    I got the answer, Here is the sql if any one need:

    select name,
    substr(name,
    instr(name,'#')-1,
    instr(name,'#')-1
    ) ,
    substr(name,
    instr(name,'#')+1, --start with
    instr(name,'#',1,2)-(instr(name,'#')+1) --End With
    ),
    substr(name,
    instr(name,'#',1,2)+1
    )
    from EMP;
    Raju

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