SAP Knowledge Base Article - Preview

2631510 - ALTER TABLE statement is not generated to add a mandatory column with default - SAP PD

Symptom

  • IBM DB2 for z/OS uses the ALTER TABLE ... ADD COLUMN statement to add a mandatory column with default to a table.

  • PD generates ALTER TABLE ... ADD COLUMN statement when:
       - the column is defined as NOT NULL and a default value is defined by using the DEFAULT clause (WITH DEFAULT is not used),
       - the column is nullable but WITH DEFAULT is used.

  • CREATE/DROP TABLE statements are generated when:
       - the column is defined as NOT NULL and no DEFAULT/WITH DEFAULT is used,
       - the column is defined as NOT NULL WITH DEFAULT.

  • PD should generate:

ALTER TABLE table-name
ADD COLUMN column-name data-type NOT NULL [default-clause]

when
   - the column is not mandatory,
   - or a default value is defined,
   - or the column is Identity,
   - or the column is defined as WITH DEFAULT,
   - or the column has the GENERATED clause defined.

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."


Read more...

Environment

  • SAP PowerDesigner (PD) 16.6
  • IBM DB2 for z/OS

Product

SAP PowerDesigner 16.6

Keywords

db2mvs, nulls, 814540, CR814540, CR#814540 , KBA , BC-SYB-PD , PowerDesigner , Bug Filed

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.