Export Query Result via SQL Inserts WITHOUT database prefix

Answered

Greetings,

I am attempting to export the results from an SQL from one database into another. The export is generated by all the insert statements have a database prefixed table names, which makes the export useless for me as I want to load the inserts into a different database.

Is there a setting I can disable this behaviour - i.e. do not prefix the table name with a database name?

Thank you for any help.

3
7 comments
Avatar
Permanently deleted user

Hello? Is this possible? The current export is useless for me.

1

@Nazar Aziz

To change default behavior for export  you need to modify groovy script:

or to use find & replace in your result file.

 

 

1

I have the same problem. Was doing a migration and realise I couldn't omit the DB name, had to use `sed` to search and replace in the end. 

Would be good to make it an option to omit or include the prefix as I believe not everyone names the db locally and remote the same.

0

@resting,

Feel free to change groovy script for your needs.

0

groovy script is much slower, please support this!

0

Do we still don't have this feature?

0

Omar Tariq, what RDBMS do you work with?

And, as I mentioned before, feel free to modify groovy script. For detailed description take a look at or GitHub repo https://github.com/DataGrip/dg-scripted-extensions-environment

0

Please sign in to leave a comment.