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 Amir Michail <am...@gmail.com> on 2007/06/16 20:23:38 UTC

changing the default value for a column

Hi,

The column in question has type timestamp yet this doesn't work:

ij> alter table <tablename> alter column <columnname> default current_timestamp;
ERROR 22005: An attempt was made to get a data value of type 'long'
from a data value of type 'TIMESTAMP'.

The table does not have any rows.

Amir

Re: changing the default value for a column

Posted by Bryan Pendleton <bp...@amberpoint.com>.
Amir Michail wrote:
> The column in question has type timestamp yet this doesn't work:
> 
> ij> alter table <tablename> alter column <columnname> default 
> current_timestamp;
> ERROR 22005: An attempt was made to get a data value of type 'long'
> from a data value of type 'TIMESTAMP'.
> 
> The table does not have any rows.

Hi Amir,

I tried a trivial example, but I could not reproduce this:

-bash-2.05b$ java org.apache.derby.tools.ij
ij version 10.4
ij> connect 'jdbc:derby:brydb;create=true';
ij> create table t (c1 timestamp);
0 rows inserted/updated/deleted
ij> alter table t alter column c1 default current_timestamp;
0 rows inserted/updated/deleted


Can you see if you can construct a script which reproduces the
problem in your environment, and let us know what that script is?

thanks,

bryan