1

I am converting my regular table to partitioned table using timestamp column. However, the below code fails with sql error 2103 reason code 6. Please note that there are no referential(or foreign key constraints) on this table so wondering where I am going wrong. There is primary key and few indexes defined on TRANSACTION table. Kindly help !

I am not using any options as well for simplicity though I want to use ' KEEP, COPY_USE_LOAD,COPY_WITH_INDEXES' as option.

  CALL SYSPROC.ADMIN_MOVE_TABLE(
  'ADMIN',
  'TRANSACTION',
  '',
  '',
  '',
  '',
  '',  
  '(TRANSACTIONDATE) (STARTING FROM (1/1/2010) ENDING AT (1/1/2017) EVERY 1 MONTH)',
  '',
  '',
  'MOVE'
  )
1

The only problem seems to be your missing quotes for the dates. As they are enclosed in the string the have to be escaped (with a second single quote) like in my example:

CALL SYSPROC.ADMIN_MOVE_TABLE(
    'ADMIN',
    'TRANSACTION', 
    '', '', '', '', '',  
    '(TRANSACTIONDATE) (STARTING FROM (''1/1/2010'') ENDING AT (''1/1/2017'') EVERY 1 MONTH)', 
    '', '', 'MOVE' )
  • Thanks, works like a charm, unfortunately, i could not find it documented anywhere how to handle date in admin_move_table procedue. Thanks Michael ! – shivrajk Jul 25 '16 at 8:50
  • 1
    There is no special documentation for this as timestamps and date always need quotes in DB2 :-) – MichaelTiefenbacher Jul 25 '16 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.