there's nothing stopping you from just executing the SQL directly.      
I've never actually heard of CREATE TABLE AS before, but I just  
checked it out and you can certainly generate the SQL programmatically  
from a select, by inspecting each column in the select statement's "c"  
collection.    It appears to be part of the SQL standard so is a  
syntax we would accept (it would be appropriate for the 0.6 series  
where we have CreateTable structures available).   But SQLA is a  
"toolkit" and the tools are there already to automate this process  
without a pre-made feature.


On Jan 27, 2009, at 11:17 AM, andrew cooke wrote:

>
> (I thought this might be a FAQ, but I can't find it, and searching
> isn't turning up anything either...).
>
> Am I right n thinking it is not possible to do "CREATE TABLE .... AS"
> in SQLAlchemy?  In other words, creating a table from a select
> statement?
>
> I'm using 0.4 and Oracle.  If it is possible I would love to know how.
>
> I understand "insert from select is a TODO" (found in a recent post).
> So I guess my best bet is to just enter the entire SQL command to
> create the table literally?!
>
> (I am trying to duplicate some SQL that is currently run as a script;
> I tried replacing the table with an embedded select, which works, but
> is slower than expected.  So I need to do this both for efficiency on
> one query and also because later queries are going to use the same
> table, so I don't want to duplicate work).
>
> Thanks,
> Andrew
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to