db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Voxland" <Nathan.Voxl...@sundog.net>
Subject RE: Problem with default date values
Date Thu, 09 Aug 2007 13:52:14 GMT
I checked, and I am running 10.2.2.0.  The issue you list talks about
setting the default value for a table with rows, but my table doesn't
have any.  The full list of SQL ran against the table is:

CREATE TABLE defaultValueTest (
	id int, 
	intA int, 
	textA varchar(5), 
	booleanA SMALLINT, 
	dateA DATE, 
	timeA TIME, 
	datetimeA TIMESTAMP
);

ALTER TABLE defaultValueTest ALTER COLUMN intA WITH DEFAULT 1;
ALTER TABLE defaultValueTest ALTER COLUMN textA WITH DEFAULT 'a';
ALTER TABLE defaultValueTest ALTER COLUMN booleanA WITH DEFAULT 1;
ALTER TABLE defaultValueTest ALTER COLUMN dateA WITH DEFAULT
DATE('2007-08-09');

Does setting the default value for the other columns kick in that bug?

I'll try the latest code to see if that helps.  Are there nightly builds
available, or do I have to build it myself?

Nathan

-----Original Message-----
From: Bryan Pendleton [mailto:bpendleton@amberpoint.com] 
Sent: Wednesday, August 08, 2007 4:45 PM
To: Derby Discussion
Subject: Re: Problem with default date values

> ALTER TABLE defaultValueTest ALTER COLUMN  dateA WITH DEFAULT 
> DATE('2007-08-09')
> 
> and getting the error: "An attempt was made to get a data value of
type 
> 'long' from a data value of type 'DATE'."

It's possible you're hitting
https://issues.apache.org/jira/browse/DERBY-2371,
which was fixed in both the 10.3 and 10.2 code lines, but the 10.2 fix
was *after* the 10.2.2.0 release, so you'd have to build the 10.2 branch
yourself to get that fix.

thanks,

bryan


Mime
View raw message