Results 1 to 2 of 2

Thread: update on table

  1. #1
    Join Date
    Jul 2002
    Posts
    227

    Unanswered: update on table

    Hi,
    I've a table A with column:

    COD VARCHAR2(20)

    The col COD has this value:
    1234
    24788
    013456
    0356654 (there are so more of 1000 records)

    It's possible update (in automatic) this col with these new values?
    12000034
    24000788
    01003456
    03056654

    is necessary add zero until go to 8 charachters after first 2 char


    Thanks
    Raf

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: update on table

    Use: SUBSTR(cod,1,2) || LPAD( SUBSTR(cod,3), 6, '0' )

    But watch out for any existing COD values with LENGTH(cod) > 8 !

Posting Permissions

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