I have a table called actionParameter in the consolidated SQLAnywhere database. Within the table is a primary key column called actionParameterId. The current column type of the actionParameterId is uniqueidentifierstr. When I look at the values of the actionParameterId column, I see strange characters. I think this is due to the fact it is a uniqueidentifierstr and not a uniqueidentifier. I want to change it to a uniqueidentifier so badly... because the actionParameterId column type in the remote database is also of type uniqueidentifier. When I try to edit the column type in the Sybase Central I get the following error not allowing me to: The primary key 'actionParameterId - actionParameter (mobielcmp)' could not be deleted from the database. This operation is only allowed within a synchronization schema change [Sybase][ODBC Driver][SQL Anywhere]This operation is only allowed within a synchronization schema change SQLCODE: -1329 SQLSTATE: HY000 SQL Statement: ALTER TABLE "mobielcmp"."actionParameter" DROP PRIMARY KEY What does it mean only allowed in a synchronization schema change? Do I have to change it using the remote synchronization script? |
I will assume you're using SQL Anywhere version 12.
You assumed right, I use the latest version SQL Anywhere 12. I have created a publication earlier in the consolidated SQLAnywhere database, containing amongst others the table actionParameter. Now I have just deleted the publication and try to change the schema again. Alas, I get the following error: The column 'actionParameterId' could not be modified in the database. Cannot convert 'BY‚B˜á€ to a uniqueidentifier [Sybase][ODBC Driver][SQL Anywhere]Cannot convert 'BY‚B˜á€ to a uniqueidentifier SQLCODE: -157 SQLSTATE: 07006 SQL Statement: ALTER TABLE "mobielcmp"."actionParameter" ALTER "actionParameterId" UNIQUEIDENTIFIER
TRUNCATE TABLE "mobielcmp"."actionParameter" Could not execute statement. Data modifications are not allowed in a synchronization schema change SQLCODE=-1342, ODBC 3 State="HY000" Line 1, column 1
(23 Jan '12, 14:24)
Yanny
1
Cannot convert 'BY‚B˜á€ to a uniqueidentifier [Sybase][ODBC Driver][SQL Anywhere]Cannot convert 'BY‚B˜á€ to a uniqueidentifier Yes, as you have surmised, this means that the column you're changing the data type for contains data that cannot be converted to the new data type. TRUNCATE TABLE "mobielcmp"."actionParameter" Could not execute statement. Data modifications are not allowed in a synchronization schema change This means that you have attempted a DML statement after issuing "START SYNCHRONIZATION SCHEMA CHANGE" - Note that this statement is NOT required for a SQL Anywhere consolidated database. You only need to use this syntax for changing schema on the remote database. You need to issue 'STOP SYNCHRONIZATION SCHEMA CHANGE' to be able to modify rows once again. What does it mean? Is it the reason for all the errors I get? The icon means that it is a 'synchronized table' defined in a publication, that has been selected by a "START SYNCHRONIZATION SCHEMA CHANGE" statement and is currently 'locked' (which prevents modifying the data inside the table).
(24 Jan '12, 12:50)
Jeff Albion
Thank you Jeff for the additional comment. :) I have execute the STOP SYNCHRONIZATION SCHEMA CHANGE query and after that I was able to truncate the table. Then I successfully changed the PK column type to uniqueidentifier.
(24 Jan '12, 14:05)
Yanny
|