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

How to Get data from database(table) to an excel sheet

2 Answers   iGate,


How do you find an object in an gui map.

0 Answers  


When do you feel you need to modify the logical name?

0 Answers  


can anybody tell me which type of questions raised on ERP domine in interviews?

0 Answers  


Are you created any custom dialog box during test runs?

1 Answers   MBT,






Can we use the user defined functions (which inclues script with GUI functions) in Compile module? Example: public function MyGuiFun() { set_window(?Browser main window?); button_press(?OK?); } If yes. pls give some example, how to handle...!

1 Answers  


Hi,please help me out with my ques:in winrunner the object will be reconzined in the form of label or class.

1 Answers  


What is Add Watch?

6 Answers   Accenture,


I want to know is there any latest Win Runner Technology? If then plz tell me in detail. Thanks

7 Answers  


what is qtp licence

0 Answers  


what is the use of generate script that is avaliable 3 places(file settings, tools, object identification)

0 Answers  


Which function in TSL invokes AUT

3 Answers  


Categories