4 Replies Latest reply: Dec 12, 2012 5:28 AM by 979209 RSS

    ttBulkCp with default values

    979209
      Hello,

      I need do a "special" load using default values in a table.
      This is the example:

      table to unload -->
      desc iduser.TB_TABLE_1;

      Table iduser.TB_TABLE_1:
      Columns:
      *col1                      INTEGER NOT NULL
      col2 CHAR (1) NOT NULL
      col3 CHAR (1) NOT NULL
      col4 CHAR (1) NOT NULL
      col5 CHAR (1) NOT NULL
      col6 CHAR (1) NOT NULL

      $ ttBulkCp -o -v1 dsn_prueba iduser.TB_TABLE_1 prueba.txt

      $ tail prueba.txt
      1216,"1","0","0","0","0"
      1219,"0","0","1","1","1"
      1220,"1","0","0","0","0"
      1223,"0","0","1","1","1"
      1224,"0","0","0","0","0"
      1225,"0","0","0","0","0"
      1226,"0","0","0","1","0"
      1227,"0","1","0","1","0"
      1232,"0","0","0","0","0"
      # 1683/1683 rows copied

      table to load -->
      desc iduser.TB_TABLE_2;

      Table iduser.TB_TABLE_2:
      Columns:
      *col1                      INTEGER NOT NULL
      col2 CHAR (1) NOT NULL
      col3 CHAR (1) NOT NULL
      col4 CHAR (1) NOT NULL
      col5 CHAR (1) NOT NULL
      col6 CHAR (1) NOT NULL
      col7 CHAR (1 BYTE) DEFAULT '0'
      col8 CHAR (1 BYTE) DEFAULT '0'
      col9 CHAR (1 BYTE) DEFAULT '0'
      col10 CHAR (1 BYTE) DEFAULT '0'

      $ ttBulkCp -i -v0 dsn_prueba iduser.TB_TABLE_2 prueba.txt

      ### ERROR:
      ### Too few attributes on input line.
      404,"0","1","0","1","0"
      # (row was not inserted)

      It don't use default values in target table.

      Is possible solve this with ttBulkCp tool ???
      Any idea about this will be good received.

      Thanks in advance,
      Babs