Wednesday, September 5, 2007

QTP Tutorials 13 - Importing Database Table

For this tutorial make sure you completed the Database checkpoint tutorial successfully. Because the connection we made in that tutorial with the oracle will be used here.

It is very simple to import data from database into Data Table.

Right-click somewhere inside the data table.


Go to Sheet->Import->From Database...
"Database Query Wizard" opens.

Click on the radio button "Specify SQL statement manually".

(make sure that "Maximum number of rows" checkbox is NOT checked)


Click Next

Click Create button.

"Select Data Source" window opens

Click "Machine Data Source" Tab

Select Oracle from there and click ok.

Enter password for oracle in the "Oracle ODBC Driver Connect window"

After entering password when you click on ok, it open "Database Query Wizard" window with 'Connection string' automatically filled with info like DSN, UID etc.

Enter SQL statement "select * from emp;" in SQL statement Box.

Click Finish and lo the data is there in the data table.