title: spaces in not null column in db2 table using import command
body: <p>I have two tables in two different databases with same structure. </p>
  
  <p>I am exporting one table into a .dat file and then importing it to other table using db2 import command:</p>
  
  <pre><code>import from $TEMP_DIR/TO_IMPORT.dat of del modified by dateformat=\"YYYY-MM-DD\" timeformat=\"HH:MM:SS\" timestampformat=\"YYYY-MM-DD HH:MM:SS.UUU\" chardel0x01 coldel|  COMMITCOUNT 1000 messages $LOG_DIR/to_import.log insert into MY_SCHEMA.MY_TABLE
  </code></pre>
  
  <p>A row in TO_IMPORT.dat is as below:</p>
  
  <pre><code>col1_val|col2_val|col3_val|col4_val|col5_val
  </code></pre>
  
  <p>The delimiter is '|'</p>
  
  <p>col1, col2, col3 are NOT NULL columns in source and destination tables.</p>
  
  <p>However, in source table, in some of the rows, col2 and col3 are having spaces in them instead of character values. </p>
  
  <p>These are coming in .dat file as below:</p>
  
  <pre><code>abc| | |def|pqr
  </code></pre>
  
  <p>Now, during import of above row, these spaces are getting considered as NULL and thus everthing fails on trying to insert a null value in a not null column of destination table. </p>
  
  <p>What is the solution/workaround for this problem ?</p>
  
  <p>Thanks for reading!</p>