[MonetDB-users] (some) Numeric columns don't allow NULL?
Hello again, I've got a column declared as such: foo NUMERIC(9, 2), When I try and enter NULL values into it, it gives the following error: !SQLException:int:"" is no decimal value (doesn't contain a '.') Now, the message itself had me confused (still does actually), but I figured out by trial that it was complaining that I was shoving a NULL value in that column. Can someone explain why a NULL value can't go it here? (There is no "NOT NULL" on the column) Also columns defined as "NUMERIC(7,0)" allow NULL values..... Confused..... -matt
On Nov 15, 2007 4:58 PM, m h
Hello again,
I've got a column declared as such:
foo NUMERIC(9, 2),
When I try and enter NULL values into it, it gives the following error:
!SQLException:int:"" is no decimal value (doesn't contain a '.')
Now, the message itself had me confused (still does actually), but I figured out by trial that it was complaining that I was shoving a NULL value in that column. Can someone explain why a NULL value can't go it here? (There is no "NOT NULL" on the column) Also columns defined as "NUMERIC(7,0)" allow NULL values.....
Confused.....
More information. It appears that if the table is empty (or new as mine was), that column can't have a NULL value for the initial entry. After putting a row in that has a non NULL value, the NULL one will go in. This seems like a hacky workaround for me. Also, I tried explicitly defining the column as: foo NUMERIC(9, 2) NULL, (as in it takes NULLs, not NOT NULL), and I get the same behavior. Rejects initial NULL values, after non NULL value entered, NULL values go in...
On Thu, Nov 15, 2007 at 09:36:38PM -0700, m h wrote:
On Nov 15, 2007 4:58 PM, m h
wrote: Confused.....
Sorry, one more message, I should add that this is using the command line client, not python.
Matt Could you include the statements used (ie both create table and insert statements)? Maybe also report this possible bug via the bugtracker at sourceforge? Many thanks. Niels
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
On Nov 16, 2007 1:33 AM, Niels Nes
On Thu, Nov 15, 2007 at 09:36:38PM -0700, m h wrote:
On Nov 15, 2007 4:58 PM, m h
wrote: Confused.....
Sorry, one more message, I should add that this is using the command line client, not python.
Matt
Could you include the statements used (ie both create table and insert statements)? Maybe also report this possible bug via the bugtracker at sourceforge? Many thanks.
Here's the bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1833286&group_id=56967&atid=482468 Here's the SQL to recreate it: DROP TABLE decimal_null; CREATE TABLE decimal_null ( promoid NUMERIC(8, 2) ); ' this will fail INSERT into "decimal_null" values (NULL); ' this will work INSERT into "decimal_null" values (2.3); 'now the one that failed will work INSERT into "decimal_null" values (NULL);
participants (2)
-
m h
-
Niels Nes