Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 98419 invoked from network); 26 Nov 2006 22:43:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2006 22:43:47 -0000 Received: (qmail 35673 invoked by uid 500); 26 Nov 2006 22:43:56 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 35644 invoked by uid 500); 26 Nov 2006 22:43:55 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 35635 invoked by uid 99); 26 Nov 2006 22:43:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 14:43:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 14:43:45 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 990A27142F7 for ; Sun, 26 Nov 2006 14:43:25 -0800 (PST) Message-ID: <11050064.1164581005624.JavaMail.jira@brutus> Date: Sun, 26 Nov 2006 14:43:25 -0800 (PST) From: "James F. Adams (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-64) Create a table with a query In-Reply-To: <1984807828.1100122224169.JavaMail.apache@nagoya> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ 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