Interview Questions

Looking for a tool whcih can do bulk data insert to various tables in the test database and also that tool which work with DB2, SQLServer and Oracle.

Software QA/Testing Technical FAQs


(Continued from previous question...)

Looking for a tool whcih can do bulk data insert to various tables in the test database and also that tool which work with DB2, SQLServer and Oracle.


Answer1:
First copy the existing data to an excel file by DTS import/export wizard in SQL server 2000
Export the contents of the table to an excel file . In the Excel change the integrity constraints. for example the table had one primary key column. So using excel you just changed the values of the priamary key by using linear fill option of Excel. Then save it.
Now import data from this excel sheet to the table.

Answer2:
Using Perl and their DBI modules. You will also need DBD modules for the specific databases that you want to test with. In theory, you should be able to re-use the scripts and just change DBD connections or possibly create handles to all three RDBMSs simultaneously. Ruby and Python have similar facilities.
You will just have to have access to the data files somewhere and then you can then read the data and insert the data into the database using the correct insert statements.
There are other tools, but since they cost money to purchase I have never bothered to investigate them.
Scripting is the most powerful (and cheapest) way to do it. preferred method is to use Python and its ODBC module. This way you can use the same code and just change the data source for whichever DB you're connecting to. Also, you could potentially have the script generate random data if you don't have any source data to begin with.
need to have the proper ODBC client drivers installed on the box you're running the script from for the ODBC module. There's also a PyPerl distribution that will let you use the Perl DBI module with Python. It's really up to personal preference on what you're comfortable scripting in.

(Continued on next question...)

Other Interview Questions