AWS Schema Conversion Tool
User Guide (Version 1.0)

Conversion Issues with UPDATE

Issue 6669: FROM clause was rewritten

The FROM clause in UPDATE statements is rewritten during PostgreSQL to MySQL conversion. For example, take the following PostgreSQL statement.

update test_pg_mysql.customers c set id = +1, name =, postcode = o.order_sum from test_pg_mysql.orders o where =;

This statement is converted to the following MySQL statement.

update customers c set id = +1, name = (select name from orders where id =, postcode = (select order_sum from orders where id = where in (select id from orders);

Review this code to make sure it produces the results that you expect.

Issue 6066: MySQL doesn't support the UPDATE statement with the RETURNING option

To perform this operation, convert the UPDATE statement with the RETURNING clause into an UPDATE statement with following INSERT statements that have the specified key conditions in the SELECT clause.

Issue 6670: MySQL does not support update by cursor

MySQL doesn't support updating a table from within a cursor, as shown in the following example.

DECLARE c1 CURSOR FOR SELECT id FROM test_pg_mysql.customers; val numeric(14,0); BEGIN OPEN c1; fetch c1 into val; update test_pg_mysql.customers set name = 'nfhr' where current of c1; CLOSE c1; END

Perform a manual conversion instead.

Related Topics