Fetch updated data from MySQL to excel - mysql

Is there any way to fetch the data from MySQL to EXCEL. I tried doing it by a standard way(ODBC).
But is there any way by which all the tables data can be fetched into excel tables at once so that I can draw charts using them. If any data is added in MySQL the updated data should be reflected in Excel when I open it next time and graph should be updated.
Any way to do that?

U need to write code for that.
If u are using .Net then you can directly export file in the form of excel. But if u r using java then u need to write code for that. u need to use jxl.jar .
hint for that is given in URL which is given below.
http://javamix.wordpress.com/2009/05/01/inserting-data-into-excel-sheet-using-jexcel-api/

You can export your data from MySQL as Excel using any of the MySQL GUI tools like SQLyog, MySQL Workbench. I use SQLyog, here is the screen shot attached, where it can be done very easily.
But I fear, there is any direct and simple way to update data in Excel when one changes in MySQL.
Hope this helps.

Related

How to load sample.xlsx in oracle data base using sql loader

I am trying to load my data which is in excel format but i am not able to do that.could you please help me on this.
It would have been easier for us if you came up with some screenshots or codes but If you want to load it using SQL Loader, you'll need to save it as a CSV first. Then the delimiter will be a commas, which you have.
Or you can load it as Excel using SQL Developer:
http://www.thatjeffsmith.com/archive/2012/04/how-to-import-from-excel-to-oracle-with-sql-developer/
Hope this helps!!

In db2 on cloud Lite version, is it possible to export sql query results to csv? How?

How do I export results of an sql query as a csv using db2 on cloud Lite version? Is it possible, or is a paid level required for this? I found the link in the results field “export to csv” but when I clicked on it, nothing happened. Similarly, in the query field on the left side of the screen there is a link to export to csv, but that didn’t work either. I would like to export to a form that can be used in WEKA.
I have a Db2 on Cloud Lite and I can confirm that it works. I am using the Run SQL dialog to query the database. The button to actually run a query is a dropdown where you can choose to run the selected statement and export the result to a CSV or XLSX (Excel) file.
The export action is handled like a regular download. Depending on the browser you may see a pop-up or just a file in your download directory.

Easiest way to continually import data to MySQL from a dbf file on my local computer

I have a problem that has been annoying me for quite some time now and a few days ago I started googling for a solution, but I haven't really gotten anything to work. I've read a little about something called SSIS, but I'm not sure it does what I'm looking for or if there is something else I should research in order to accomplish my goal. This is my problem:
My accounting program produces and updates a .dbf file with information about all vouchers and places it in a folder on my local computer. Our MySQL must continually be updated with this information. So this is what I do twice a day:
I open up the .dbf file in excel
Save it as a .csv.
Close Excel
Open the file in notepad++
Convert the formating to utf8
Save
log in to MySQL
Go to the right table
Upload the .csv
Replace the old data with the new
As this takes quite a bit of time, I feel that there must be better ways to do this. It would be great if I could have this scheduled to be done automatically or if there is some kind of an SQL query that could do this, because then I could use PHP to make a website that I could enter and have the query run when I press a button or something.
So my question is: What is the most simple way to continually get the info from the .dbf file into my SQL server?
There is a way to do your job by shedule with DBF Commander Pro's command-line interface. Use the following command in a *.BAT file:
dbfcommander.exe -edb <dbf_file_name> <server_table_name> <connection_string>
After that, create a shedule for this BAT file using Windows Sheduler.
The only issue remains, that you need to clear the destination table on MySQL database before the export process.
In order to try the export process in app GUI, click 'File -> Export to DBMS'. In the window appears click Build button in order to build the connection string: select MS OLEDB Provider for MySQL Server, then choose your server from the list, provide login and password, select a database, click OK:
In the Export to DBMS window select the destination table you want to import source DBF file to, then click Export. The command line you need you can find at the bottom part of the window.
More info on import and export DBF to a database you can find here. Detailed using of command-line is here.
As you mention of doing in PHP. What is stopping you from doing it there.
You could create one connection handle using a VFPOleDB provider to open the path location of the table, open and read the table. Then have a SECOND connection to your MySQL database open and ready to push the data there.
Then, for each row read from the VFP OleDB connection result set, do whatever special cleansing you need to.
Then, query from the MySQL connection if its an existing entry or not and if an add or update is necessary, then send the data respectively.
Continue for the rest of the records from the VFP result set.
No need to open in Excel, save to CSV format, load yet another tool, etc...

updating excel file data using vba from mysql

Is it possible to have an excel sheet that gets updated from a mysql server using a specific query when ever it gets opened using VBA?
I am new to VBA and is it possible to monitor the data changes on the excel sheet while updating the sheet??
Thanks
If you use the Data > Get External Data toolbar to set up the MySQL data pull, you can then set the workbook to refresh upon opening - Here's a link that shows the very basics.
As for tracking / moitoring changes, you'd have to be more detailed about how you'd like that to happen... As a general rule, it's not very easy to do.
Hope this helps!!

How to extract data from excel file into the database in Mysql at runtime in asp.net?

I am creating a website...and i want to give a liberty to users, to upload the data of excel file and then i want to save that excel data inside mysql database on runtime...
kindly help me in performing this task...
you can mail me at...."amiteshsinha09#rediffmail.com"
thank you
Amitesh
You can query the data in the excel sheet using Open Xml
Using this instead of running Excel via interop is both faster, more stable and saves you licence costs.