[ 
http://issues.apache.org/jira/browse/DERBY-64?page=comments#action_12457097 ] 
            
Manish Khettry commented on DERBY-64:
-------------------------------------

I spent some time looking at the patch and it looks like a good first stab at 
the compile and bind phase. The execution of this DDL takes place in in 
CreateTableConstantAction. I would think that to populate the table with the 
results of the queryr, you would need to call generate on the query tree and 
somehow execute it. It may also help to see how a simple select query is 
compiled to byte code and executed.

I should add the caveat that I am not a commiter and not very familiar with the 
code since I work on it off and on, so hopefully others more familiar with the 
code  will jump in with their take on the patch.

Do existing tests psas with your changes? It seems even without the WITH DATA 
option it is a useful addition to the sysetm.



> 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, Derby64Patch2.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

        

Reply via email to