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

wahat do u mean by exceptional handling in winrunner

3 Answers  


When it is appropriate to change physical description?

0 Answers  


What is the difference bitween Client/Server Applications and Web Applicaions?

5 Answers   iSoft, Patni,


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

1 Answers  


please tell me how to explain the project by taking any project (like banking product), how to start explaing?what will be the order of priority e.g.,like purpose, modules, HLDs LLDs etc., in testing point of view (as a testengineer). rightnow i can't explain my project though i've done successfully..so plz help me ..

9 Answers   HCL, IBM, ITC Infotech, Raisoni, TCS, Wipro,


How to recogonise dynamically changing objects in an application(ie Web or Standalone)

1 Answers  


In my application I was supposed to test two columns.The first column1 belongs to one module and the other column2 belongs to other module.The content in both the columns is same.I supposed to check whether the data present in the column1 is same as the one in column2. Each column contains number of rows.So checking each row manually is diificult.Is there any option available in WinRunner or QTP to check the column data.These two columns are available in Data Base Tables. One way is that I can just number of rows in each column so that I can get rows count of both the columns,but apart from that I was supposed to check whether the data is also same in both the tables. Can anybody suggest me how I can go about this.

1 Answers  


hi,i am sudha.i am married.i had done my BE in 2005.i learnt testing tools.i dont no how to tell about my self.please send me good answer about that infomation i gave.

8 Answers  


Hai guys can any one tell me tnhe difference between the product testing and Project testing?

2 Answers  


how can we upload manul test caseses in to test director

1 Answers  


Testing work start at once

1 Answers   Manhattan,


what is the difference between data driven test(ddt) and parametrization

7 Answers   Agile Software, CTS,


Categories