Entradas populares

How to export data from a Database to Excel?

In this entry I will explain how to export data from a Database (in this case Oracle) using Excel (version 2007). The point is that later We can import this information easily in other database, and Excel files allow us to modify it very simply

Well lets get to work, the procedure is very easy,,,,

1-First of all we should configure a ODBC connection against the Database, in our cas ORACLE, to do this we should go, to Administrative tools -> Data Sources (ODBC)


2-In the ODBC, we will check that we have installed the driver we will use to connect to the Database, in this case we will use driver named Oracle in ora92 (we have installed previously)


3- Then we will open Excel (the Excel version we use is 2007), and we will set and we will configure and External Origin of Data. To do this, go to the tab Data -> From Other Sources -> From Microsoft Query, as we can see in the screenshot.


4- In the next screen we will select New Data Origin (the part marked with the red box)


5-Now we have to type the name of the connection we are setting up (the one you want), and the driver of the connection we will use, as we said before Oracle in Ora92



6-And Now click on the connect button, and a new windows will appear, and we will be asked to type, SERVICE of the Oracle database, a USER and PASSWORD. Remenber that this user may have permissions to do selects to the database from which we want to export data


7- Now a new window will appear, in it we will be able to see the tables of our database, we will select the table from which we want to export the data


8- If we click in the table we will see the columns of it


9 - And it we click on the arrow in the red box, we will add all the columns to the select.


10- In the next screen, we will select the option View data or Edit Query in Microsoft query


11- Once we have done this, Microsoft Query will be opened, in which we will able to see the data of the table, and all the columns of it.... and if now we click on the button in the red box , where we can read SQL



12- Now, is the most interesting part, a window will be open, and we will see the select that is being executed, and modify it for our liking. In the screenshot yo will see that this is a good old SELECT. IMPORTANT REMEMBER THAT AS WE ARE WORKING AGAINST A ORACLE DATABASE THE T-SQL, MUST BE ORACLE T-SQL

13- Once we have modified the select to our needs, and we need to be returned the data to Excel, just click File -> Return data to Microsoft Excel


14- Excel will be opened with the next windows, we will click accept.



15- When we have finished all these steps, Excel will be opened, and it will show all the data from the select we have done.


And Folks, have the information in Excel can give use a lot of possibilities to work with this data, whether it is, import this file directly to other database , conver this file into an other kind of file.... in sum everything we want...

Have fun exporting you data.... :-D

0 comentarios: