none
querying multiple databases to form a single datatable in a DS RRS feed

  • Question

  • I have to query multiple databases to form a single table in a dataset.

    for eg:

    I have 3 Data Tables 1 each from SQL, oracle and MySQL.

    Now i need to find a way via code to be able to merge these tables into a single table.

    I know the relationships between the 3 tables but how do i build them because of varying data types representations.

    What are the different ways i can achieve this in via code.

     

    Wednesday, May 4, 2011 8:00 AM

Answers

  • hello ,

    you can merge them if you have datatypes and fields match in tables.with use of merge method.

    alternatively, you need to write down code and create new table manually. I can give you these steps.

    1) Create new destination table through code and add columns and it's datatype which you would like to have in your final table.

    2) create destination table row

    3) fetch record from first table and assign value in row(destination table) created earlier 

    4) fetch record from second table and assign value, (here this record should be fetched with relation among tables), same for the third table.

    5) add row to destination table

    6) repeat this process until you reached to end of your records.

    i hope this make sense to create new destination table with combining of all three tables.


    Thanks and Regards, Shailesh B. Davara
    Thursday, May 5, 2011 10:25 AM