Subject Re: [firebird-support] Changing col from Time to Timestamp
Author Svein Erling Tysvaer
Yes, this should be possible, by either

UPDATE DAVID
SET "TIME" = CAST(TIME_OLD AS DATETIME)

This sets the DATE part of the timestamp to CURRENT_DATE.

You should also be able to do

UPDATE DAVID
SET "TIME" = CAST(DATE_OLD+TIME_OLD AS DATETIME)

or similar.

HTH,
Set
(I haven't tried any of this, but am pretty confident it should work)

tickerboo2002 wrote:
> I have a database out in the wild that contains a table with a column
> of type Time. It should be of type Timestamp. How would I go about
> changing my users' databases?
>
> My first inclination is to try the following:
>
>
> 1. Rename existing column to TIME_Old
> 2. Create a new column TIME of type TimeStamp
> 3. Perform an update on the table, copying everything from TIME_Old to
> TIME
> 4. Delete TIME_Old column
>
> It's step 3 I'm not too sure about. Is it possible to execute an
> UPDATE statement where the contents of one column (TIME_Old) are
> copied to another column (TIME) ? If so, is there any special syntax
> for it?
>
> TIA
>
> David