Error when I changed TWO fields Names

If you think that something doesn't work in Aware IM post your message here
Post Reply
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Error when I changed TWO fields Names

Post by ab042 »

I was making some changes to an attribute "Max Length" and at a different time I also RENAMED two of the attribute names.

There was NO errors reported during the process until I went to publish the app and it gave me an error that said somethings about the OLD attribute name was used in one of the forms. I went and fixed it on the form and rechecked the integrity without error.

Upon publish it returned: ERROR ALTERING column yyyyy for table yyyy to type yyyy varchar(3) Data Truncated for column 'yyyy' at row 4
And the NEXT TIME it returned: ERROR ALTERING COLUMN xxxx to table xxxx to type xxxx varchar(3) Unknown column 'xxxxx' in 'xxxx'

And of course since we have no way to manually clear or correct this problem in the database. I'm screwed until someone responded to this message.

I'm assuming and maybe incorrectly so, that you have some kind of change logic your storing so you can make the necessary changes to the underlying database at publish time and I am not sure if the Truncated error some how aborted your change logic and screwed everything up or you may be attempting to process the length change logic after you already renamed the field.

Regardless something is screwed up. Maybe you should have a feature under tools remove the scheduled publish change logic that effects that column and continue or something?

Or even an option to drop / recreate table and ignore additional table changes, would work during development if we don't have much data. At least where not at a stand still and the option is ours to make.
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

It turns out that MySQL 5.0 does now allow changing text data to a smaller length if it involves truncation. Aware IM did not keep up with this change and we will fix it.

You have several options now:

1) Change the length of the attribute back to the original length (or at least make sure that the longest record you have in your data does not exceed the new length, so that MySQL does not have to truncate). Then publish the version again.
2) Manually truncate long records or make them NULL.
If you have an old published version you can do it from Aware IM in the browser. Otherwise you can do it at the database level. To do this open mysql utility and issue the following commands:
a) use BASDB (or use BASDBTEST if you are using testing mode)
b) UPDATE 'tableName' SET attributeName='truncated_value'
where tableName has the following format:
businessSpaceName_objectName
(in testing mode businessSpaceName is BASTestdomainBusinessSpaceName)
3) If you don't care about your existing data the simplest approach is to export business space version, recreate business space, import the version and publish. Or if you are using testing mode just publish with no initial data.
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

Thank you. I exported and recreated and everything is fine now.

Thanks again for the fast reply
Post Reply