[ 
http://issues.apache.org/jira/browse/DDLUTILS-114?page=comments#action_12417250 
] 

Andreas Wurzer commented on DDLUTILS-114:
-----------------------------------------

It's a DB2 Database i generate the schema-file from (I use the 
databaseToDdl-task with the writeSchemaToFile-subtask), the original table 
looks like:
 CREATE TABLE "CONT_CONTRACTELEMENTPREMIUM"  (
...
                  "F_NETANNUALSUBSCRIPTIONAMOUNT" DECIMAL(20,4) WITH DEFAULT 
NULL, 
                  "F_BRUTTOANNUALPREMIUMAMOUNT" DECIMAL(20,4) WITH DEFAULT 
NULL, 
                  "F_PAYMENTADDITIONRATE" DECIMAL(20,4) WITH DEFAULT NULL, 
                  "F_BRUTTOPREMIUMPRORATAAMOUNT" DECIMAL(20,4) WITH DEFAULT 
NULL, 
                  "F_NETPREMIUMPRORATAAMOUNT" DECIMAL(20,4) WITH DEFAULT NULL, 
                  "F_NETPREMRISKOWNERPRAMOUNT" DECIMAL(20,4) WITH DEFAULT NULL, 
                  "F_NETPREMSERVICEPRAMOUNT" DECIMAL(20,4) WITH DEFAULT NULL, 
                  "F_NETPREMIUMSALEPRORATAAMOUNT" DECIMAL(20,4) WITH DEFAULT 
NULL, 
                  "F_PREMIUMDISCOUNTRATEAMOUNT" DECIMAL(20,4) WITH DEFAULT 
NULL, 
...
);
The generated schema-file for this table is:
    <table name="CONT_CONTRACTELEMENTPREMIUM">
...
      <column name="F_NETANNUALSUBSCRIPTIONAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_BRUTTOANNUALPREMIUMAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_PAYMENTADDITIONRATE" primaryKey="false" required="false" 
type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_BRUTTOPREMIUMPRORATAAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_NETPREMIUMPRORATAAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_NETPREMRISKOWNERPRAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_NETPREMSERVICEPRAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_NETPREMIUMSALEPRORATAAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
      <column name="F_PREMIUMDISCOUNTRATEAMOUNT" primaryKey="false" 
required="false" type="DECIMAL" size="20" default="NULL" autoIncrement="false"/>
...
    </table>
Then i applied the schema-file to an empty derby database and the 
decimal-scales are gone (of course - they are not mentioned in the schema-file).
With the attached fix (scale-fix.diff), decimal-scales are exported and 
imported correctly.

> decimal scale never gets written to schema-file in WriteSchema* Tasks
> ---------------------------------------------------------------------
>
>          Key: DDLUTILS-114
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-114
>      Project: DdlUtils
>         Type: Bug

>   Components: Core
>     Reporter: Andreas Wurzer
>     Assignee: Thomas Dudziak
>  Attachments: scale-fix.diff
>
> when doing writeSchemaToFile (or other writeSchema Task), the scale of a 
> decimal column never gets written to the schema file

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to