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

Thread: truncate the column length

  1. #1
    Join Date
    Sep 2002
    Posts
    376

    truncate the column length

    I have a column varachar2(2000).

    Now, While inserting/updating this column, if the data is more than 2000 bytes, i want to truncate that to 2000 length and discard rest of the data

    how can i achieve this ?

    Thx
    ------------------------------------------------------------------------
    The most enjoyable things in the world are either Immoral or too Expensive or otherwise Inaccessible anyway

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    substr(VariableName,1,2000)
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Sep 2002
    Posts
    376
    Thx.
    ------------------------------------------------------------------------
    The most enjoyable things in the world are either Immoral or too Expensive or otherwise Inaccessible anyway

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