I have a list of tables that need to copied from one database to another. The list of tables resides in the table in a DB. I am trying to write a Standard Macro to perform this. This is what I have so far:
The macro reads the in list of tables and then reads that using the Dynamic Input. But I am unsure how to write the tables to the second DB. Please advise.
You can do this with a batch macro where each batch will bring in a different table. The Dynamic Input tool will not work because the tables are of different schemas.
The workflow will have a Control Parameter (set to the table name) and updating an Input Data tool. This will then go to an Output Tool that has the "Take File/Table Name from field" option selected.
Related
I would like to do the below operation using Pentaho spoon/PDI.
Copy data from the Mysql source database to the Mysql target database.
2)After that I would like to truncate/Delete Data from Source Database
Can Someone help with this?
Just run two transformations and one job:
First transformation: Table input step to read table data from source database and Table output step to write said data to table in target database
Second transformation: Truncate table in Source database. I don't remember if there's a specific step for this or if you could use a job step instead of a transformation running a SQL script to truncate the table. Just check what you have available in Pentaho, I don't have it opened at the moment to verify.
Job: After successfully running First transformation run the second transformation or the step.
Now, you can complicate matters from this depending on your situation:
Do you need to replicate a whole database instead of just one table? You'll need to add steps to work with Metadata Injection, so you run the first a second transformations for all the tables in the source database. You can read the dictionary tables in the source database to inject the information about table names and columns to the transformations so you don't create one pair of transformations for each table.
Do you need to create the tables in the target database before populating them? You'll need to add additional transformations to read the metadata of the table to create and build the script to create said table in the target database before populating it.
And so on
I'm using Pentaho Data Integration for my ETL process...
I have multiple excel files that I need to merge and upload in one database. However, I cannot Distribute the fields into its corresponding tables in the database. I can only send it to one table at a time. Is there any other way to do this? How can I have multiple target table?
P.S. I'm using MySQL Workbench for the database.
Thank you for your help!
You can connect multiple Table output steps to your last processing step and set it to copy all rows to both or all target steps. Connect Table outputs (or Insert/update, etc) like in the image, then right-click the step where the stream splits and select Copy Data to Next Steps. In the Table outputs you obviously only specify the columns that apply to that table.
i am trying to compare the data of two mysql databases using the redgate data compare tool for mysql. The tool identifies two databases with identical data as having different tables. How can i solve this?
I hope it will be work in redgate tool after creating a new project. and on Object Mapping tab ,
select an Unmapped table or view that you want to map from the source database.
Select the Unmapped table or view that you want to map from the target database.
Click Map.SQL Data Compare moves the tables or views to the upper pane.
I have created a data model in Access Database.
Tables that are composite parts of the model are loaded with data. Some of the data needs to be loaded manually.
Now I would like to link couple of tables together and give the user the option to insert the missing data in the tables. (I am linking the tables together so that the user doesn't have to work with raw keys, but with the "actual" information that he knows.)
I+ve never worked with Access DB before and therefore I would like to ask you to please instruct and help me on how to accomplish my goal?
The access form wizards are pretty well put together. You can easily setup a form that will allow them to insert data into the table(s).
As the title says: I've got a bunch of tab-separated text files containing data.
I know that if I use 'CREATE TABLE' statements to set up all the tables manually, I can then import them into the waiting tables, using 'load data' or 'mysqlimport'.
But is there any way in MySQL to create tables automatically based on the tab files? Seems like there ought to be. (I know that MySQL might have to guess the data type of each column, but you could specify that in the first row of the tab files.)
No, there isn't. You need to CREATE a TABLE first in any case.
Automatically creating tables and guessing field types is not part of the DBMS's job. That is a task best left to an external tool or application (That then creates the necessary CREATE statements).
If your willing to type the data types in the first row, why not type a proper CREATE TABLE statement.
Then you can export the excel data as a txt file and use
LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table;