In adobe campaign classic v7, in a schema, if I change the datatype of an attribute like integer to string, what is going to happen to the existing data?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @rbiri ,
When you change the datatype of an attribute, you have to update the database structure. While doing this, you can notice in SQL statement that the existing old data type column will get dropped and a new field will get created in the table with new datatype, with the same internal name.
ALTER TABLE SchemaName
ADD COLUMN sMyColumn VARCHAR(255);
ANALYZE SchemaName;
ALTER TABLE SchemaName
DROP COLUMN iMyColumn;
So while dropping the old data type column, all the data will also get deleted along with the field. And a new field will get created with the new data type and data will be empty for this field.
To save the data, you can export the data to a CSV file and after changing the data type and updating the database structure, import the file using import workflow and update the records into the schema.
Hello @rbiri If you are changing int to string then it should be ok. I have not done it myself but i would suggest testing it on a lower env first.
If you see anything is breaking then create a new attribute as string and move data from old attribute to new attribute by in the correct datatype.
Hi @rbiri ,
When you change the datatype of an attribute, you have to update the database structure. While doing this, you can notice in SQL statement that the existing old data type column will get dropped and a new field will get created in the table with new datatype, with the same internal name.
ALTER TABLE SchemaName
ADD COLUMN sMyColumn VARCHAR(255);
ANALYZE SchemaName;
ALTER TABLE SchemaName
DROP COLUMN iMyColumn;
So while dropping the old data type column, all the data will also get deleted along with the field. And a new field will get created with the new data type and data will be empty for this field.
To save the data, you can export the data to a CSV file and after changing the data type and updating the database structure, import the file using import workflow and update the records into the schema.
Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies