You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by David Myers <da...@gmail.com> on 2012/09/06 10:45:44 UTC
Error 42x71:Type de donnÚes 'BOOLEAN' non valide: when doing a Create Table [table] as Select * from [otherTable] with no data
Hello all.
I suspect this may be a bug, but how to test!
below is the following command I entered into IJ
create table admin.GROSSESSE as select * from S1.GROSSESSE with no data;
ERREUR 42X71 : Type de donnÚes 'BOOLEAN' non valide pour la colonne 'ECHO'.
Just to demonstrate that the table S1.Grossesse exists I ran a
describe... here is the result
ij> describe S1.Grossesse;
COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
QGROSSESSE |INTEGER |0 |10 |10 |NULL |NULL |NO
OBS |VARCHAR |NULL|NULL|9 |NULL |18 |NO
DDR |TIMESTAMP|9 |10 |29 |NULL |NULL |YES
TERME |TIMESTAMP|9 |10 |29 |NULL |NULL |YES
FECNORM |INTEGER |0 |10 |10 |NULL |NULL |YES
FECINVIVO |INTEGER |0 |10 |10 |NULL |NULL |YES
QANOMALIE |INTEGER |0 |10 |10 |NULL |NULL |YES
DEXAM |TIMESTAMP|9 |10 |29 |NULL |NULL |YES
ECHO |BOOLEAN |NULL|NULL|1 |NULL |NULL |YES
AMNIO |BOOLEAN |NULL|NULL|1 |NULL |NULL |YES
AFP |BOOLEAN |NULL|NULL|1 |NULL |NULL |YES
AUTRE |BOOLEAN |NULL|NULL|1 |NULL |NULL |YES
EXINFO |VARCHAR |NULL|NULL|255 |NULL |510 |YES
NPREVAB |INTEGER |0 |10 |10 |NULL |NULL |YES
MED |VARCHAR |NULL|NULL|255 |NULL |510 |YES
SORTIE |INTEGER |0 |10 |10 |NULL |NULL |YES
FACEVO |INTEGER |0 |10 |10 |NULL |NULL |YES
FACDETAIL |LONG VAR&|NULL|NULL|32700 |NULL |NULL |YES
GNOM |VARCHAR |NULL|NULL|100 |NULL |200 |YES
GPNOM |VARCHAR |NULL|NULL|100 |NULL |200 |YES
GADDR |VARCHAR |NULL|NULL|100 |NULL |200 |YES
GTYPE |VARCHAR |NULL|NULL|50 |NULL |100 |YES
GTEL |VARCHAR |NULL|NULL|14 |NULL |28 |YES
GFAX |VARCHAR |NULL|NULL|14 |NULL |28 |YES
And to confirm that the schema 'admin' really exists...
ij> show tables in admin;
TABLE_SCHEM |TABLE_NAME |REMARKS
------------------------------------------------------------------------
ADMIN |CAPSULE |
ADMIN |CL_AINT |
ADMIN |CL_ALD |
ADMIN |CL_AP |
ADMIN |CL_AUM |
ADMIN |CL_BOOLYN |
ADMIN |CL_CMAGE |
ADMIN |CL_CMLOC |
ADMIN |CL_CMTYP |
ADMIN |CL_DSI |
ADMIN |CL_HBIBE |
ADMIN |CL_HBIDA |
ADMIN |CL_HBIMA |
ADMIN |CL_LONG |
ADMIN |CL_MOTIF |
ADMIN |CL_Q1A6 |
ADMIN |CL_SEX |
ADMIN |CL_STOMIE |
ADMIN |CL_USER_TYPE |
ADMIN |CM |
ADMIN |DM |
ADMIN |DVD |
ADMIN |EQUIPE_INFO |
ADMIN |EX |
So the schema exists:
So I did a quick test, creating a new table 'boolTest'
create table app.boolTest (boolTest Boolean);
0 lignes insÚrÚes/mises Ó jour/supprimÚes
describe app.boolTest;
COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
BOOLTEST |BOOLEAN |NULL|NULL|1 |NULL |NULL |YES
So the 'boolean' word definately works, just not in the instance of a
create table as statement.
Anyone got any ideas?
David
What else can I now do?
Re: Error 42x71:Type de donnÚes 'BOOLEAN' non valide: when doing a Create Table [table] as Select * from [otherTable] with no data
Posted by david myers <da...@gmail.com>.
On 06/09/12 19:43, Rick Hillegas wrote:
> On 9/6/12 9:41 AM, Bryan Pendleton wrote:
>>> So the 'boolean' word definately works, just not in the instance of a
>>> create table as statement.
>>
>> Yes, that sounds like a bug. Boolean has recently been added to the
>> DDL language, and this might have been missed.
> Right, I agree with Bryan that this is a bug. This limitation was put
> in when CREATE TABLE AS SELECT was added. At that time, the BOOLEAN
> datatype was still disabled for user tables. Without this limitation,
> people could have created user tables with BOOLEAN columns by issuing
> a CREATE TABLE AS SELECT against a system table with a BOOLEAN column.
> I have logged https://issues.apache.org/jira/browse/DERBY-5918 to
> track this issue. I think it should be easy to fix. Thanks for finding
> this bug, David.
>
> Regards,
> -Rick
>>
>> Did you try searching JIRA to see if it's a known bug? If not, please
>> log a bug with your reproduction script.
>>
>>> What else can I now do?
>>
>> Did you try doing CREATE TABLE first, followed by INSERT INTO
>> newtable SELECT FROM oldtable?
>>
>> If INSERT ... SELECT has the same bug, then you'll probably have to
>> write a short program to do the processing yourself.
>>
>> thanks,
>>
>> bryan
>>
>>
>>
>
Hello All,
@Bryan
I know for a fact that I can insert into a table boolean values in from
a prepared statement, I have a script that does it for about 300+ rows.
It doesn't do an insert into... as select * from because of the
limitations of the data source.
@Rik
No probs for finding the bug, I was a little surprised that I got the
error, my script just stopped with a strange SQL error. I was very
confused as the rest of the script hapily copied lots of rows with at
least a handful of boolean values in them. I did find things on JIRA
about the <create table as> being added, but couldn't add a bug as I
couldn't remember my jira log on (its saved on my pc at home not at work).
Maybe I'll try to fix this bug after I've finished my other enhancement
I'm wanting to write.
David
Re: Error 42x71:Type de donnÚes 'BOOLEAN' non valide: when doing a Create Table [table] as Select * from [otherTable] with no data
Posted by Rick Hillegas <ri...@oracle.com>.
On 9/6/12 9:41 AM, Bryan Pendleton wrote:
>> So the 'boolean' word definately works, just not in the instance of a
>> create table as statement.
>
> Yes, that sounds like a bug. Boolean has recently been added to the
> DDL language, and this might have been missed.
Right, I agree with Bryan that this is a bug. This limitation was put in
when CREATE TABLE AS SELECT was added. At that time, the BOOLEAN
datatype was still disabled for user tables. Without this limitation,
people could have created user tables with BOOLEAN columns by issuing a
CREATE TABLE AS SELECT against a system table with a BOOLEAN column. I
have logged https://issues.apache.org/jira/browse/DERBY-5918 to track
this issue. I think it should be easy to fix. Thanks for finding this
bug, David.
Regards,
-Rick
>
> Did you try searching JIRA to see if it's a known bug? If not, please
> log a bug with your reproduction script.
>
>> What else can I now do?
>
> Did you try doing CREATE TABLE first, followed by INSERT INTO newtable
> SELECT FROM oldtable?
>
> If INSERT ... SELECT has the same bug, then you'll probably have to
> write a short program to do the processing yourself.
>
> thanks,
>
> bryan
>
>
>
Re: Error 42x71:Type de donnÚes 'BOOLEAN' non valide: when doing a Create Table [table] as Select * from [otherTable] with no data
Posted by Bryan Pendleton <bp...@gmail.com>.
> So the 'boolean' word definately works, just not in the instance of a
> create table as statement.
Yes, that sounds like a bug. Boolean has recently been added to the
DDL language, and this might have been missed.
Did you try searching JIRA to see if it's a known bug? If not, please
log a bug with your reproduction script.
> What else can I now do?
Did you try doing CREATE TABLE first, followed by INSERT INTO newtable SELECT FROM oldtable?
If INSERT ... SELECT has the same bug, then you'll probably have to
write a short program to do the processing yourself.
thanks,
bryan