Programatically export to remote database

Discuss the spreadsheet application

Programatically export to remote database

Postby keneso » Thu Nov 21, 2019 1:44 pm

Hi

I have a website (Php/MySql), and need to import data to a database table, as of now, there is an import page on the web application, and works fine by selecting and importing as .csv
My question is if it is possible to do so from my local machine programatically (or manually?) whenever I update the .csv file directly from calc without going to the import page thru the browser, basically by clicking an "upload button" within calc.
If yes, how?

Thank you.
OpenOffice 4.0 XP
keneso
 
Posts: 46
Joined: Sun Nov 10, 2013 10:58 pm

Re: programatically export to remote database

Postby Villeroy » Thu Nov 21, 2019 2:34 pm

viewtopic.php?f=21&t=95587

Normally, you do not need any kind of office suite or spreadsheet application to import csv into a database. csv is a database exchange format. csv has nothing to do with spreadsheets.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 27744
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: programatically export to remote database

Postby robleyd » Thu Nov 21, 2019 2:45 pm

From what I read in OP's question, they want the exported CSV file to be somehow uploaded to a web page that will then process the CSV into a MySQL database.

Unfortunately the question doesn't tell us how the web page functions; for example does it require selecting a file to upload for processing, or perhaps the CSV is pasted into a textarea, or...

I suspect this might be done as a macro using an external language, e.g. Python but given the lack of detail it isn't possible to say. It is also possible that the time to produce such a tool probably wouldn't be offset by savings in upload times, especially if the OP is not familiar with programming.
Cheers
David
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3142
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: programatically export to remote database

Postby keneso » Thu Nov 21, 2019 3:05 pm

Thank you for your replies.

Sorry for the confusion, please let me detail it more.

The workflow is like this:
Data is created on a spreadsheet, and then saved as .csv to be imported (the file) to the database.
Right now the import is done by the webpage (and works fine) thru an upload file field/button i.e. select file, click import.

Problem is the import might occur several times a day, and going each time to the page to select, and upload could become tedious, and time consuming, whereas if we could automate the process, and having the spreadsheet (in .csv) to connect each time is updated, and saved (without the need to open browser, and going to the import page), would help a lot.
OpenOffice 4.0 XP
keneso
 
Posts: 46
Joined: Sun Nov 10, 2013 10:58 pm

Re: programatically export to remote database

Postby Villeroy » Thu Nov 21, 2019 3:11 pm

With my solution you don't need the csv. Connect a Base document to your database, prepare a spreadsheet with the named cells and call the macro to update the database table with spreadsheet data.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 27744
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: programatically export to remote database

Postby keneso » Thu Nov 21, 2019 5:17 pm

Villeroy wrote:With my solution you don't need the csv. Connect a Base document to your database, prepare a spreadsheet with the named cells and call the macro to update the database table with spreadsheet data.


My bad, I had missed the link in your first post.
I'll try, and see what I can do; will report back in next days.

Thank you.
OpenOffice 4.0 XP
keneso
 
Posts: 46
Joined: Sun Nov 10, 2013 10:58 pm


Return to Calc

Who is online

Users browsing this forum: MSN [Bot] and 11 guests