Varchar length question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • geno
    New Member
    • Aug 2011
    • 2

    Varchar length question

    If you have a varchar defined as 100 bytes and you mistakenly set the varchar length field to 101 will you get a DB2 error attempting to write the data or will the data be written but truncated?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Try it and you'll know.

    Comment

    • geno
      New Member
      • Aug 2011
      • 2

      #3
      Rabbit. I do not have the ablility to test it so I asked the forum. If this is the type of response I am to expect from the forum then this isn't the site to be on.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        I'm sorry for the short response but you did not say you didn't have a way to insert/update records yourself. I do not appreciate it when members ask a question that they can easily test themselves. It comes off as lazy and we don't need members who aren't willing to put in some work. I had assumed you had a way to insert/update records because I don't see why you would ask the question otherwise.

        As for the question, if you attempt to insert/update a record with a string longer than the maximum length that was set, it will error out.

        Comment

        Working...