db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6956) Create table as Select cannot copy Decimal columns
Date Tue, 15 Aug 2017 14:22:00 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16127293#comment-16127293
] 

Bryan Pendleton commented on DERBY-6956:
----------------------------------------

It's not clear to me why we make this check for CREATE TABLE AS SELECT, but not for simple
CREATE TABLE.

Anyway, two possibilities occur to me:
# Increase the maximum width for DECIMAL to 33, since clearly we desire to allow 31 digits,
an optional sign, and an optional decimal point
# Remove the check against maximum width, if, as Rick suggested, we aren't sure why we're
making that check.

> Create table as Select cannot copy Decimal columns
> --------------------------------------------------
>
>                 Key: DERBY-6956
>                 URL: https://issues.apache.org/jira/browse/DERBY-6956
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, SQL
>    Affects Versions: 10.13.1.1
>         Environment: Windows 7, DataGrip
>            Reporter: Murat Cengiz
>              Labels: newbie
>
> I create a test table with the following query:
> CREATE TABLE "DERBYTEST" ("STRINGCOLUMN" varchar(255), "INTEGERCOLUMN" integer, "SHORTCOLUMN"
varchar(255), "LONGCOLUMN" bigint, "DOUBLECOLUMN" double, "FLOATCOLUMN" double, "DECIMALCOLUMN"
decimal(31, 6), "BOOLEANCOLUMN" smallint, "DATECOLUMN" timestamp, "DATETIMECOLUMN" timestamp,
"ID" integer, "LASTMODTIME" timestamp, PRIMARY KEY ("ID"))
> this query completes successfully
> I later try to copy the table with the following query:
> CREATE TABLE "DERBYTEST_TEMP" AS SELECT * FROM DERBYTEST WITH NO DATA
> This throws the following exception:
> [42X71][30000] Invalid data type 'DECIMAL(31, 6)' for column 'DECIMALCOLUMN'
> Everything works perfectly fine if I remove the decimal column.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message