Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to skip failed lines in migration file #240

Open
chiruyarabolu opened this issue Jul 28, 2022 · 1 comment
Open

How to skip failed lines in migration file #240

chiruyarabolu opened this issue Jul 28, 2022 · 1 comment

Comments

@chiruyarabolu
Copy link

chiruyarabolu commented Jul 28, 2022

Hello Team,

I have a script which has multiple lines of db execution lines in which if any of the lines are failed while executing it is not picking up the next lines. Any way to skip the failed lines and execute the next lines?

Ex : INSERT INTO table1 (LOCALE, TRANSLATIONGUID, TRANSLATIONKEY, TRANSLATIONVALUE) VALUES ('en-US', 'translationguid', 'translationkey.', 'Value');

INSERT INTO TABLE1 (LOCALE, TRANSLATIONGUID, TRANSLATIONKEY, TRANSLATIONVALUE) VALUES ('en-US', 'translationguid', 'translationkey', 'value');

The execution of 1st line got failed due to the below error
Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (MYBATIS1.UX_1_ASTRANSLATION) violated

Any way to skip this line of execution and execute the following lines?

@harawata
Copy link
Member

Hello @chiruyarabolu ,

You have to figure out a way to avoid the unique constraint violation.
For Oracle, you should be able to use MERGE statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants