Search code examples
sql-updateoracle-apexbulk-load

Can an APEX database be extracted from so it can be edited/cleaned and uploaded so it overwrites the old data?


I have a database of 10,000 records that needs a serious clean up. I'm wondering if I can extract the data from APEX (Oracle Application Express) clean it up and re-upload it to the database so that it overwrites the old data?

It would save days of time if I can bulk edit data through excel and I expect to take it one table at a time.

I'm trying to achieve this without going near the front end system if possible.

If I'm way off base and there is a simpler way of going about this please let me know.

No attempts yet as I'm worried about corrupting data before getting all the information.


Solution

  • Here is one way, using APEX. This is just using utilities that come with APEX-, not writing any apps. Do the steps below for any table:

    • SQL Workshop > Utilities > Data Workshop
    • Pick "Unload Data" and download the data into an xml file. Make sure the primary key column is included
    • Play with your data and save the file
    • SQL Workshop > Utilities > Data Workshop
    • Pick "Load Data" to upload the file and upload it into a different table
    • in sql, write a MERGE statement to update selected columns in the original table for any rows you modified.
    • drop the table in which you uploaded the data

    However, this is just an answer to your question, I'm not saying this is "the best" option. The best option depends on the problem you're trying to solve. The question is very vague. "serious clean up" is very subjective. Is it dates in wrong format ? Duplicate rows ? Something else ? Depending on what you want to do the answer might differ. The solution above is only good for changing values in individual rows. For dates in the wrong format or duplicate rows there are probably better solutions in pure sql or pl/sql.