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

Thread: Rtrim

  1. #1
    Join Date
    Jun 2003
    Posts
    132

    Rtrim

    Hello,

    Does anyone have a better solution to my problem.

    Please see this thread.
    http://www.dbasupport.com/forums/sho...threadid=37631

    Thank You

    Roman

  2. #2
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    409
    Not sure if this is more elegant, but this is one more way you can try.

    Code:
    sql> select * from testip;
    
    IPCOL
    --------------------------------------------------
    199.171.216.254:22808
    199.171.216.255:22808
    199.171.216.256:22808
    199.171.216.257:22808
    
    Elapsed: 00:00:00.15
    sql> select substr(ipcol, 1, instr(ipcol, ':', 1, 1) - 1 ) from testip;
    
    SUBSTR(IPCOL,1,INSTR(IPCOL,':',1,1)-1)
    --------------------------------------------------
    199.171.216.254
    199.171.216.255
    199.171.216.256
    199.171.216.257
    
    Elapsed: 00:00:00.16
    sql> update testip set ipcol = substr(ipcol, 1, instr(ipcol, ':', 1, 1) - 1 ) ;
    
    4 rows updated.
    
    Elapsed: 00:00:00.16
    sql> select * from  testip;
    
    IPCOL
    --------------------------------------------------
    199.171.216.254
    199.171.216.255
    199.171.216.256
    199.171.216.257
    
    Elapsed: 00:00:00.16
    -- Dilip

  3. #3
    Join Date
    Jul 2001
    Location
    Slovenia
    Posts
    422
    Better - in what context?
    Tomaž
    "A common mistake that people make when trying to design something completely
    foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams

  4. #4
    Join Date
    Jun 2003
    Posts
    132
    Right on target patel_dil.

    Thank you

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    closing, duplicate.
    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