Subject | Re: Corrupt database |
---|---|
Author | zifnabbe |
Post date | 2004-05-01T12:37:09Z |
> If this is related to your previous Restore problem, then it seemslikely
> you have a "rogue" character occupying a column that is a foreignkey. You
> could write a stored procedure that loops through the table as acursor,
> writing the value from the problem column into a variable of thecorrect
> character set.Yes, it is related with the previous restore problem.
What do you mean with "rogue" character?
Do you mean by this a wrong value?
> declare variable fkvalue varchar(n) character set ISO_8859_1;code in here
> FOR SELECT PK_PERSONS FROM PERSONS
> FOR UPDATE
> INTO :FKVALUE
> AS CURSOR MYCURSOR
> DO
> BEGIN
> // if it's not Fb 1.5, you'll need to put some do-nothing
>exception you
> END
>
> When the loop encounters the bad character, it will throw the
> have seen elsewhere. Use the GDSCODE to trap the faulty value:column)
>
> WHEN GDSCODE transliteration_failed do
> begin
> update persons
> set pk_persons = null
> where current of mycursor;
> end
> end
> If you can't set the value to null (because it is not a nullable
> then you'll need to prepare a "dummy parent" beforehand, bycreating a
> master record with a pk value that is empty string. Commit it, ofcourse.
>Thanks, I'll try this out.
> Then your sp can do
>
> set pk_persons = ''
> where current of mycursor;
>
> /heLen
Regards,
Tom