db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Myers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5918) CREATE TABLE AS SELECT doesn't work on tables with BOOLEAN columns
Date Thu, 06 Sep 2012 19:01:08 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13449944#comment-13449944

David Myers commented on DERBY-5918:

By way of a work around if this is a required functionality for you use the following process.

Connect to your DB.

capture a result set of the source table, and examine the resultSetMetaData for each field
one at a time.

build a <Create Table [tableName].... > by capturing your colum names and type data
from the above metaData object.

If anyone needs it I can post method code that does this... I just don't have it to hand right
this instant.

(only downside is it requires you to write a java class, to hold the connection info and an
apropriate method).

As I say I'll try to attach a couple of java files untill a 'proper' fix is initiated
> CREATE TABLE AS SELECT doesn't work on tables with BOOLEAN columns
> ------------------------------------------------------------------
>                 Key: DERBY-5918
>                 URL: https://issues.apache.org/jira/browse/DERBY-5918
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:
>            Reporter: Rick Hillegas
> You can't use CREATE TABLE AS SELECT from a table with a BOOLEAN column. This limitation
was put in when CREATE TABLE AS SELECT was added. At that time you could not create user tables
with BOOLEAN columns and we did not want people to be able to subvert that restriction by
using CREATE TABLE AS SELECT from a system table with BOOLEAN columns. The following script
shows this problem:
> connect 'jdbc:derby:memory:db;create=true';
> create table t1( a int );
> create table t2( a boolean );
> create table t3 as select * from t1 with no data;
> create table t4 as select * from t2 with no data;

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message