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

What is the purpose of set_window command?

0 Answers  


descriptive program for web application.

0 Answers  


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

7 Answers   Agile Software, CTS,


Hi,i cleared the first round in Microstrategy and my second round(project manager) is scheduled so can any one tel me what r they asked and gv me some steps how i wil tel them?

1 Answers  


ca n u give the eample for low severity & high priority in ur Internet Banking project

2 Answers   Agile Software,






list out the some of the exceptions list usually occur while recording and playing the script.

1 Answers  


What r the recording methods in winrunner and wht r the uses and where do we use and how do we use? pls dont mention recording modes(context sensitive and analong)

2 Answers  


what is winrunner framework

1 Answers   Covansys,


Hi guys pls any one help me , I am facing this problem since last one week , my question is in there 1000 rows and 1000 coloums , i want to pick the one record , how ?

1 Answers  


how many checkpoints are provided by WR

3 Answers   Ordain Solutions,


what are Obligatory and Optional properties in Winrunner? what is the use of those explain in detail..

2 Answers   Kanbay,


Explain data parameterization in winrunner?

0 Answers  


Categories