You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/03/21 16:45:25 UTC

[jira] [Commented] (TRAFODION-1901) allow more flexible column-definition in create table ddl

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

ASF GitHub Bot commented on TRAFODION-1901:
-------------------------------------------

GitHub user anoopsharma00 opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/398

    JIRA TRAFODION-1901 Default clause can appear in any order during create

    Default clause can now appear in any order during column definition of
    a create table or alter table statement.
    One can specify any mix of "not null", "default", "constraint..." and other
    column attributes.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/anoopsharma00/incubator-trafodion defclause_br

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/398.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #398
    
----
commit 59b3d03d2a7878caad396d3d9b2bbee6a3b86bce
Author: Anoop Sharma <an...@edev06.esgyn.local>
Date:   2016-03-21T15:36:30Z

    JIRA TRAFODION-1901 Default clause can appear in any order during create.

----


> allow more flexible column-definition in create table ddl
> ---------------------------------------------------------
>
>                 Key: TRAFODION-1901
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-1901
>             Project: Apache Trafodion
>          Issue Type: Improvement
>            Reporter: liu ming
>            Assignee: Anoop Sharma
>
> Current Trafodion DDL syntax for CREATE TABLE is very strict to ANSI standard about column-definition.
> column-definition is:
> column data-type
> [DEFAULT default | NO DEFAULT]
> [[CONSTRAINT constraint-name] column-constraint]
> So constraint like 'NOT NULL' must follow the DEFAULT descriptor. In many other databases, this is allowed. So if Trafodion make this more flexible, it will help database migration.
> Here is a test case:
> CREATE TABLE TABLETEST1
> (MARK_ID     SMALLINT        NOT NULL,
>   BEGIN_TIME  DATE            NOT NULL  DEFAULT date'2008-01-01',
>   END_TIME    DATE            NOT NULL  DEFAULT date'2018-01-01',
>   ACTIVE_FLAG SMALLINT,
>   MARK_NAME   VARCHAR(20),
>   DESC_TXT    VARCHAR(80),
>   primary key(MARK_ID, BEGIN_TIME, END_TIME)
> );
> *** ERROR[15001] A syntax error occurred at or before:
> CREATE TABLE TABLETEST  (MARK_ID     SMALLINT        NO
> T NULL,   BEGIN_TIME  DATE            NOT NULL  DEFAULT date'2008-01-01',   END
>                                                       ^ (134 characters from start of SQL statement)
> *** ERROR[8822] The statement was not prepared.
> Trafodion support of above DDL will greatly simplify the database migration from other databases into Trafodion.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)