Creating CTAS programatically

If you are using ODBC please see this post Query is getting cancelled after 30 sec when run from ODBC client - #5 by mohanmane