Quick Tip: Global Where Clause for Database Exports

thatjeffsmith SQL Developer 0 Comments

Tell Others About This Story:

Want to export a ton of tables, but only get SOME of the records?

Want to apply a GLOBAL filter across the tables to only get the records you want?

Tools > Database Export.

I’m going to export data, NOT DDL.

I’m going to write it to a single JSON file.

I’m going to grab data from a couple of tables.

I ONLY want records from those tables where the CUSTOMER ID is in a specific range.

export tables dialog in sql developer with filters

My tables, and filters.

Note the bottom box – that’s a WHERE clause predicate I can have added to EVERY SELECT * from query we use to get the data to export the tables.

I can also see what this data will look like to see if my filters are correct.

sql developer oracle data export table filtering

Here I can see the global filter applied, and add a table specific filter too.

EXISTS (SELECT id FROM IDS WHERE cust_id = id)

Note you can do row-counts and sorts to make sure the data is JUST right before you export it.

Export, and then you get your data.

json data dump

Lots of tables, only the records I want from a single filter.

Related Posts Plugin for WordPress, Blogger...
Tell Others About This Story:

Leave a Reply

Your email address will not be published. Required fields are marked *