Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009

    Unanswered: Padding while inserting into the table


    I am trying to load the data file into one table in db2.

    the table have one of the column as amount. the length of that column is 10 digits but in the data file its different, so while loading tha file into the table I have to left pad the amount with 0s.

    For example..

    the data in the file for amount field is 435 and 2356 then after loading the data into that table the table should have 0000000435, 0000002356

    can anyone help me on this?

  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    It is generally a bad idea to store numbers as strings in the database. I suggest you change the column data type to numeric and format the numbers upon selecting from the table.

Tags for this Thread

Posting Permissions

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