Wednesday, 23 April 2008

What to do if a procedure/trigger/view fails to convert

Sometimes a procedure, function, trigger or view will fail to convert. An error will popup in the migration log "Failed to convert blah blah". The case maybe that the object is hundreds of lines long but one line is causing the translator to fail.

Heres how I go about identifying that problematic clause so you can continue the migration.

  1. Copy the ddl into the Translation Scratch Editor (Migrations> Translation Scratch Editor)(TSE)
  2. Select the correct translator from the TSE toolbar.
  3. Translate it
  4. If it translates , then you can use the converted PL/SQL as the starting point. Paste it into your converted model, report the bug and continue with your migration.
  5. If it fails, then I comment out half of the statements (still leaving valid T-SQL, dont cut words or statements in half :) )
  6. Keep commenting out parts of the objects ddl until you it translates and you have comented out a particular statement or clause. You can then paste the generated PL/SQL into your converted model, log a bug and continue your migration.

Often there is 1 style of syntax that the translator doesnt recognize, but because the same developer wrote many of the procedures, the same syntax occurs again and again. Once you can recognize what the issue is, you can modify the captured model suitably and then report a bug so that it can be automated in the next release.