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

Rick Hillegas commented on DERBY-268:
-------------------------------------

Hi Eranda,

That is the right code for creating a table element list (if there isn't one 
already). Now you just need to put a node on that list. The node will represent 
the instruction to restart the identity column at a new value. Here's how 
sqlgrammar.jj constructs that node when it sees an ALTER TABLE ALTER 
COLUMN...RESTART WITH... statement:

        <RESTART> <WITH> autoIncrementRestartWith = exactNumber()
        {
                autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_START_INDEX] = 
autoIncrementRestartWith;
                autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_CREATE_MODIFY] = 
ColumnDefinitionNode.MODIFY_AUTOINCREMENT_RESTART_VALUE;
                return (TableElementNode) nodeFactory.getNode(
                                                
C_NodeTypes.MODIFY_COLUMN_DEFAULT_NODE,
                                                columnName,
                                                null, null, autoIncrementInfo,
                                                getContextManager());
        }

Hope this helps,
-Rick

> Add Support for truncate table
> ------------------------------
>
>                 Key: DERBY-268
>                 URL: https://issues.apache.org/jira/browse/DERBY-268
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Lance Andersen
>            Assignee: Eranda Sooriyabandara
>            Priority: Minor
>         Attachments: changes.diff, 
> derby-268-01-ab-enableForInsaneBuilds.diff, derby-268-02-aa-permsTest.diff, 
> derby-268-03-aa-npe.diff, Derby-268.diff, Derby-268.diff, tests.diff, 
> TruncateConcurrency.java, TruncateConcurrency.java, TruncateConcurrency.java
>
>
> Adding support for truncate table command will aid to portability

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to