Subject Re: problem using backup
Author Fikret Hasovic
Hi Helen.
> I am suspicious that you changed the data type by altering the
system
> tables. Using ALTER TABLE XY ALTER COLUMN ATIMESTAMP TYPE DATE
should have
> thrown an exception, because you can't change the type if the new
type
> would cause data to be lost.
>
I am using IBExpert as tool.


> You certain don't need to make a new DB. The first thing to try
will be to
> convert the timestamps into date format, using an UPDATE statement:
>
> update atable
> set atimestamp = cast(atimestamp as date)
> where atimestamp is not null;
>
> If it won't let you do that, then try a double-cast to get rid of
any
> significant sub-
> day data:
> ...
> set atimestamp = cast (cast (atimestamp as date) as timestamp);
> ...
> (Of course, this is going to get you into a stew if you're using
dialect 1
> so I hope that's not where you're at - assume dialect 3)
>
> Now, if you can't get that to backup and restore, you *still* don't
have to
> create a new DB, but it's a much longer job and you'd need to do it
in a
> script to avoid going crazy.
>
> Alter table atable add tempcol DATE, commit, update atable set
tempcol =
> cast(atimestamp as date), commit, alter atable drop atimestamp,
commit,
> alter atable add asubstitute DATE, commit, update atable set
asubstitute =
> tempcol, commit, alter table drop tempcol, commit.
> (sorry that's gabbled)
>
> I'm curious how you managed to get the timestamps if you didn't
want
> them. The datapump should have given you the ability to cast the
> timestamps to date and store them how you needed them...erm, unless
you ARE
> in dialect 1, and DID ask for DATE - 'cause the DATE type in
dialect 1 is a
> timestamp.
>
I am using dialect 3, and I will try everything you sugested.
Thank you.

Best regards
Fikret Hasovic
TAMP R&D Team