You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "James F. Adams (JIRA)" <ji...@apache.org> on 2006/11/26 23:43:25 UTC

[jira] Updated: (DERBY-64) Create a table with a query

     [ http://issues.apache.org/jira/browse/DERBY-64?page=all ]

James F. Adams updated DERBY-64:
--------------------------------

    Attachment: Derby64Patch1.txt

I uploaded the patch Derby64Patch1.txt.

This is certainly a work in progress and is not complete, but I uploaded it as I have a few questions and could use some guidance.

The patch includes the following:

SQLState.java and messages.xml were modified to add three messages to flag various errors.  These error messages are similar to those used by CREATE VIEW.  I was wondering if I should have parameterized the two messages that differ only in the use of TABLE instead of VIEW?

sqlgrammer.jj was modified to support the following syntax:

CREATE TABLE new_table AS subquery WITH [NO] DATA

CreateTableNode.java was modified to define a new init method to take a result column list and a query expression.  The bindStatement method was modified to bind the quiery expression and create the table element list from the result column list and the query expression.

The current patch does not implement the WITH DATA option.  When WITH DATA is specified the table should be populated with the result of the query expression.  It is not obvious to me how this should be implemented.  Any guideance would be greatly appreciated.

Things left to do:

Implement the WITH DATA option.
Implement tests.
Update documentation.

> Create a table with a query
> ---------------------------
>
>                 Key: DERBY-64
>                 URL: http://issues.apache.org/jira/browse/DERBY-64
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>            Reporter: Christian d'Heureuse
>         Assigned To: James F. Adams
>         Attachments: Derby64Patch1.txt
>
>
> I suggest to implement a SQL statement to create and fill a table with a query, without having to write the columns definition.
> e.g.:
>  CREATE TABLE new_table AS SELECT ...;
> or:
>  SELECT ... INTO new_table FROM ...;

-- 
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