darold / ora2pg

Ora2Pg is a free tool used to migrate an Oracle database to a PostgreSQL compatible schema. It connects your Oracle database, scan it automatically and extracts its structure or data, it then generates SQL scripts that you can load into PostgreSQL.
http://www.ora2pg.com/
GNU General Public License v3.0
1.02k stars 343 forks source link

new files for code inside autonomous transactions #657

Closed okbob closed 6 years ago

okbob commented 6 years ago

After upgrade to master, the ora2pg produces _atx files.

Is possible to disable this behave and store all code to one file?

darold commented 6 years ago

I can't reproduce this behavior, the wrapper function and the _atx function are always exported in the same file. They are concatenated into the same variable (lib/Ora2Pg.pm line 12405) before being dumped to file. Do you have a sample to reproduce?

About autonomous transaction when 11 will be out I will add a configuration directive to enable export of autonomous transaction as new procedure calls. This will remove the use of the dblink wrapper workaround.

okbob commented 6 years ago

2018-06-22 8:19 GMT+02:00 Gilles Darold notifications@github.com:

I can't reproduce this behavior, the wrapper function and the _atx function are always exported in the same file. They are concatenated into the same variable (lib/Ora2Pg.pm line 12405) before being dumped to file. Do you have a sample to reproduce?

I'll recheck it.

About autonomous transaction when 11 will be out I will add a configuration directive to enable export of autonomous transaction as new procedure calls. This will remove the use of the dblink wrapper workaround.

I don't have a idea how procedures can help with it. autonomous transactions are unsupported still

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/darold/ora2pg/issues/657#issuecomment-399333023, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhXc0rPk50v8J8_C6KvI4dukRR6ckxWks5t_IxWgaJpZM4UzLvl .

darold commented 6 years ago

In new PROCEDURE object you can call COMMIT inside the code, this can act as an autonomous transaction.

okbob commented 6 years ago

2018-06-22 8:40 GMT+02:00 Gilles Darold notifications@github.com:

In new PROCEDURE object you can call COMMIT inside the code, this can act as an autonomous transaction.

It is available only when there are not any outer transactions - etc when the procedure was started by CALL command, and when it is not nested to some command started by SELECT.

The Oracle procedures can be translated to PostgreSQL 11 procedures - but unfortunately, autonomous transactions not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/darold/ora2pg/issues/657#issuecomment-399337606, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhXcyUX_wI3lVrvjKv1cxb0TApSBGexks5t_JFYgaJpZM4UzLvl .

darold commented 6 years ago

Oh, ok I should have deeper look in this new feature.

okbob commented 6 years ago

It is false alarm. My colleague didn't use correct words when he reported internal issue. I am sorry.