Query to transfer from ODBC - mysql

I have a database connection using ODBC.. i want to write a query to transfer all tables and columns to export the data in DOMO..
select* from database ()
Can someone help in a query where i can replace only with the new data?

Assuming the ODBC database connection has been made (using Domo workbench or cloud connector) and the data is present in Domo, you can add a transform (in MySql or Redshift - refer screenshot), in which you can write your query [select * from database].
Once you have finished writing your transform(s), you can 'Add Output Dataset' (see screenshot) to extract the data.Screenshot

Related

How to retrieve data from phpmyadmin in mysql workbench

I have used database -> reverse engineer to retrieve the schema from phpmyadmin. But when I tried it, the data records that filled in table do not appear in mysql workbench. The things that appear is only the relation and the structure/attribute of the tables. What should I do so that the data records can be retrieve from phpmyadmin? Thank you
Try exporting the database in .sql
Select Database > Export > SQL > Go
You probably tried to reverse engineer the script in the modeling section, which creates a model from the content. A model doesn't work with the actual data, but only the meta data (schema objects and structure).
If you actually want to import the full dump into your server then open an SQL connection to it from the homescreen and execute the script there.

How do i run a SQL query against an Access database to get a complete dump of tables and records via Excel?

I have an Access database that i need a complete dump of into Excel to import into another data source.
Is there a way i could run a SQL query using "Get External Data" function from Excel and if so what should the query look like?
Try using Microsoft Query and access Access, http://office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx. There's an option to "View data or edit Query in Microsoft Query".
This is for a SQL database, however you can use the same principal and just change the connection string to Access. Then, you would loop through the Tables collection, and within that loop you would loop through the Fields collection using something like this.
Also, have a look here and see the syntax used to loop through the Access tables collection using ADOX from Excel.

Updating records in MYSQL with SSIS

I am writing an SSIS package that has a conditional split from a SQL Server source that splits records to either be updated or inserted into a MYSQL database.
The SQL Server connection has provider .NET Provider for OldDB\SQL Server Native Client 10.0.
The MYSQL connection is a MYSQL ODBC 5.1 ADO.NET connection.
I was thinking about using the OLE DB Command branching off of the conditional split to update records but I connect use this and connect to the MYSQL database.
Does anyone know how to accomplish this task?
I would write to a staging table for updates including the PK and columns to be updated and then execute an UPDATE SQL statement using that table and the table to be updated. The alternative is to use the command for every row and that just doesn't seem to perform that well in my experience - at least compared to a nice fat batch insert and a single update command.
For that matter, I guess you could do without the conditional split altogether, write everything to a staging table and then use an UPDATE and INSERT in SQL back to back.
Probably, the following MSDN blog link might help you. I haven't tried this.
How do I UPDATE and DELETE if I don’t have an OLEDB provider?
The post suggests the following three options.
Script Component
Store the data in a Recordset
Use a custom component (like Merge destination component)
The author also had posted two other articles about MySQL prior to posting the above article.
Connecting to MySQL from SSIS
Writing to a MySQL database from SSIS
Hope that points you in the right direction.

Select * from Database 1 and insert into database 2

I have 2 Database in my VB.net application. I am using 1st database for daily operations. I would like to send one of the table records to online database. How Can I do that? First database is MSSQL Online database is MYSQL. I have created connections already using MYSQL .net connector.
Any Help will be appreciated.
Regards
Have a look at using a Linked Server instance on SQL Server to write the data to MySQL using the four name notation.
SQL SERVER – Explanation and Example Four Part Name
SQL Server Four-part naming
Ok here is a rough set of steps you need to follow
Query the MSSQL database and retrieve the data you want. Storing it in a DataTable may be the best option starting off.
Loop through the DataTable rows and build an INSERT statement that will be run against the MYSQL database.
Execute the command against the MYSQL db.
This is the basics of what you need to do to get a simple working system. Also take a look at Transactions as a way to manage the rollback of data when something goes wrong.
I'm assuming this is a research project If you are planning on using this code in a production system then i would look into a different alternative such as uploading data files to a service attached to the MYSQL database. This would allow you to batch and retry an import when something goes wrong.

Calling MS Access Stored Queries with Parameters using DAAB v5.0

I wanted to find out if it is possible to call MS Access Stored Queries with parameters using DAAB.
I am using the Northwind sample database to test this scenario I have created the following Stored Query with parameter in MS Access:
PARAMETERS FirstName Text ( 255 );
SELECT Employees.ID
FROM Employees
WHERE (((Employees.[First Name])=[#FirstName]));
This query is stored with name: GetEmployeeIDByName
I have created a wrapper over the DAAB to allow access to various databases like SQL, Oracle, any OLEDB and and ODBC database.
Below is the sample code for my test:
Database db = new GenericDatabase("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Database\Access\Northwind 20071.accdb",OleDbFactory.Instance);
DbCommand cmd = db.GetStoredProcedure("GetEmployeeIDByName");
db.AddInParameter(cmd,"#FirstName",DbType.String,40);
object employeeID = db.ExecuteScalar();
I get an error Invalid Operation. I am not sure if I am calling the stored Queries correctly as I am able to call Stored Queries that do not have any parameter without any errors.
I was able to resolve the issue. The issue was with the Northwind sample database. I then imported Northwind database from SQL Server into MS Access and also created the stored queries in MS Access. Here is the detailed discussion that I had with the Enterprise Library DAAB's team: entlib.codeplex.com/Thread/View.aspx?ThreadId=223653 Hope it helps. Access does not care about the # character you can call the parameter with or without the # character.