Automatically Run query every hour in MySQL Workbench - automation

Hi I am unable to find a solution to automatically run a query every hour from MySQL Workbench and export the result to CSV File. I don't have access to create an Event in workbench and also due to no host access I can not use query to export data to csv. I am wondering is there a way by which this can be done. Can I use any low code automation software to run the workbench application in windows 11 or is there any other way I can automate this?

Related

automated mechanism to open the Oracle SQL developer in my desktop, every monday Morning at 01:00 am and run an sql query in it

I am using Oracle SQL developer 4.1.3.20.
I want an automated mechanism to open the Oracle SQL developer in my desktop -- every monday Morning at 01:00 am , connect to a DB and run an sql query in it.
I don't have the privilege to create a scheduler job in the oracle DB. I only have privilege to execute a read only query.
The Query takes long time to execute (more than 2 hours due to the size of the DB). I want the Query results to be ready in my desktop, when i come to office on Monday morning.
Please let me know how to do that. Please let me know if you need additional information.
You cannot do this. There is no way to tell SQL Developer to start, connect, and run a query from the CLI.
However, you could use the SQL program in your SQL Developer / bin directory, and script SQLcl to connect and run your query. You could have it spool the results to a CSV or formatted text report.
You can get a newer version of SQL Developer that ships with SQLcl, or go download it separately.
You on Windows, Mac, or Linux? I can try to share a bash/bat script as an example.
In Windows you you can open the “scheduled tasks” or “task scheduler” depending on what OS version you have and define a new task there. Must you use SQL Developer or can you use a Sql*Plus client and just run a predefined query and spool the results to a file?

Run SQL queries without external database

I have a text file of tab separated data. Millions of rows so I can't open it in Excel.
Is there a way to use some SQL client to load the file and run queries on it without uploading the file to a database? I.e. can my local machine function as my database?
I know I could solve this with command line scripting but I'm trying to find a solution that I can then share with the accounting department and they're scared of the command line.
You can create an ODBC datasource based on the Microsoft Text Driver. That driver should come pre-installed on any Windows PC. This uses the Jet Engine which is still somewhere in the Windows OS. Then you can use any Query tool (even MS Query) to analyse your data.

Automate export from MS Excel to MS SQL Server

Is there a way to export data from a MS Excel file into a SQL Server table automatically? Maybe this is done using a script of some kind.
If it's not possible to be completely automated, perhaps there's a way to do it using minimal user effort. (For example clicking a button or link)
There is a MS Excel spreadsheet where the data keeps having to be manually exported to SQL Server.
I've done this using Excel to Access before, but not too certain on how to do it using SQL Server (MS).
*MS Office 2013 and MS SQL Server 2012.
The other answers are ok. I just want to suggest an additional alternative.
If it is just 1 specific Excel file that is frequently updated, I would consider using VBA. For example, write some VBA code in Excel that uploads changes to the database when the spreadsheet is saved (or the user presses a button).
The problem with using a scheduled job is that Excel is basically a single user application. If someone has the spreadsheet open or is doing something in it when the scheduled job runs or moves the spreadsheet to a different folder, then the job may fail.
This way you also get the updated data in your database in something close to real time instead of waiting on a job to run. This might take more time and effort to set up though than some of the other answers.
You can use SQL Server Agent to run a scheduled job that imports data from an Excel worksheet into a SQL Server table.
The import is relatively straightforward to do using Integration Services, but if you've not used either of these before you might need to do some reading up on it.
You can do the following:
You need to create an SSIS package and then create a job to run the package.
The easiest way to create the SSIS package is with "Import and Export Data" tool of SQL Server. It has a nice step by step wizard.
You set everything it asks you from the source and the destinations. Until you get here, select the "Save SSIS Package":
Then you only have to create the job to run it :)

Automating an upload of data to rdbms from a google spreadsheet

I have a google doc that I'm using to update a table in a sql table and at the moment I do it manually; copy and paste the data from the google doc. into excel, remove the columns that I don't need then save as a CSV and upload.
I'm wondering if there is a way that I can automate this? The report it's for is daily and the upload is becoming a bit of a bore!
You can also go the python-route by utilising the following python libraries: gspread, oauth2client, pandas and sqlalchemy (source). If you want to automate it, use cron or crontab to run your python-script on a hourly, daily, weekly or monthly basis.
What DBMS do you use?
If you use Microsoft SQL Server, you can use SSIS (SQL Server Integration Services), the easiest way to do this for a novice would be to right-click on the database in SQL Server Management Studio --> Tasks --> Import Data, then follow the wizard to set up the data source (flat file / Excel file etc.) and the data destination (DB table). Once you've finished with the wizard, you can save the package and re-use it later on (or even automate it via SQL Agent job). You can edit the package in Visual Studio (aka SQL Server Data Tools) prior to deployment/automation if needed.
More on SSIS: https://msdn.microsoft.com/en-us/library/ms169917.aspx

Convert MS Access 2010 query to SQLite query

I have a query in MS Access database. I want to run this query in SQLite database. I wondering whether there is a easy way to convert the code or just change step by step?
You have several options available for viewing the contents of a sqlite database and running queries against it. When building sqlite from source you can choose to build the shell utility.
If you want something more turnkey you can install a free tool such as Sqlite Manager for Firefox or Sqlite Browser.
In both apps you can copy-and-paste your SQL that you want to execute against a SQLITE database file. Good luck!