Data Transfer from XML file to Database by using DTD
Introduction:-
In this scenario we are transferring data from XML file to database by using Data Type Definition.
We are not covering the creation of DTD file in this scenario.
3. RIght click in the Local Object Library area & select "New".
Window for creating new datastore will open.
GIve all the details.
DataStore Name:- any name you want to give.
DataStore Type:- Database.
Database Type:- here we are using Microsoft SQL Server
Database version:- Microsoft SQL Server 2008
Database Server Name:- server name
User name & Password:- Details about User name & password.
4.Click "OK" & the Datastore will be created & can be seen in the Local Object Library.
We are creating dtd file for the following type of xml file.
DTD File created for the above xml file is as follows
<?xml encoding="utf-8"?>
<!ELEMENT Employee (Details+)>
<!ELEMENT Details (Id, Name, Designation, Dept, Age, Address)>
<!ELEMENT Id (#PCDATA)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Designation (#PCDATA)>
<!ELEMENT Dept (#PCDATA)>
<!ELEMENT Age (#PCDATA)>
<!ELEMENT Address (#PCDATA)>
1) Creating DTD File Format.
Give all required details.
2. Create a Batch Job.
3. Add a dataflow into the job.
4. Build the scenario in the dataflow.
5. Open the query & do Mapping.
6. Inserting target table.
We can either import the already created table or we can use template table which afterwards will actually be created in the database.
We are using template table here
7. Save the Job & Validate it.
9. Execute the Job.
10. Check the output in the table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |