How to Import(insert) data from an excel sheet to
Database(table).

Answers were Sorted based on User's Feedback



How to Import(insert) data from an excel sheet to Database(table)...

Answer / atif

csv =comma separater version

Is This Answer Correct ?    1 Yes 2 No

How to Import(insert) data from an excel sheet to Database(table)...

Answer / naga chiranjeevi kota

Session="mysession";

connstring="DSN=DQMCHIRU;UID=scott;pwd=tiger;server=Orcl";
rc=db_connect(Session,connstring);
dqmdata = "C:\TestSheet.xls";
rc = ddt_open(dqmdata, DDT_MODE_READWRITE);

ddt_get_row_count(dqmdata,noOfRows);
printf(noOfRows);
for(i=0;i<noOfRows;i++)
#for(i=0;i<1;i++)
{
a = ddt_val_by_row(dqmdata,i+1,"a");
b = ddt_val_by_row(dqmdata,i+1,"b");
c = ddt_val_by_row(dqmdata,i+1,"c");
d = ddt_val_by_row(dqmdata,i+1,"d");
x="insert into dqmchiru values('"&a &"','"&b &"','"&c
&"','"&d&"')";
printf("R"&i+1&": "&x);
dc=db_execute_query(Session,x,rows);

}
dc=db_execute_query(Session,"Commit",rows);
db_disconnect(Session);
ddt_save(dqmdata);
ddt_close(dqmdata);


answer by: Naga Chiranjeevi Kota(iGATE)

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More WinRunner Interview Questions

Hi iam a begginer or rather new stsrter to QTP and strugling to start as i have to start writing the automated scripts for the existing manual testing could some one send me some tips ans tricks for a jump start. Any help is greatly appreciated

0 Answers   John Deere,


What is the difference between gui map and gui map files?

0 Answers  


What are Optinal Properties and Obligation Properties? please explain in detail.

2 Answers  


what is the diff. Between GUI_unload() and GUI_close()?

3 Answers   Logica CMG,


After saving the tsl script of winrunner in TestDirector, if suppose any changes made to the script in ur winrunner would it get updated in TestDirector also???????

2 Answers   Ness Technologies,


What are the couple of web functions found in the function generator and what is the purpose of them?

1 Answers  


How to carry out manual testing for a background process which does't have any user interface

1 Answers  


In general, how do you see automation fitting into the overall process of testing?

1 Answers  


how to test online application

1 Answers  


what is test bed

1 Answers   Satyam,


Does WinRunner have recovery mechanism built in?

2 Answers  


Name the different types of checkpoints?

0 Answers  


Categories