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

Thread: urgent pl/sql

  1. #1
    Join Date
    Jul 2000
    Location
    india
    Posts
    213
    Hi everybody,

    I am facing a problem ..
    the problem is i have a string like

    1,2,3,4, and using the select statements/pl/sql i want my string to give the out put like

    1,2,3,4 that means i want to remove the last comma(,)

    the can be any combination of nos say it can be

    1,10,11,17, the output should be

    1,10,11,17

    pls help

    thanks in advance

  2. #2
    Join Date
    Apr 2002
    Posts
    135
    hai

    select substr(string,1,length(string)-1) from ....


    this query will return the string with the lastone(in your case the comma ) truncated

    regards
    deepa



    [Edited by sona on 06-27-2002 at 07:54 AM]

  3. #3
    Join Date
    Nov 2001
    Location
    India
    Posts
    6
    use the below query in sqlplus and replace &x with ur string like eg '1,2,3,4,' or '1,2,3,4'

    select decode(substr(&x,-1),',',substr(&x,1,length(&x)-1),
    &x) from dual

    dharmesh

  4. #4
    Join Date
    Jul 2000
    Location
    india
    Posts
    213
    thanks to all friends...


    pras

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