How to Import(insert) data from an excel sheet to
Database(table).
Answers were Sorted based on User's Feedback
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 |
hi all this is srivalli i had completed my b.e in 2005, i want to learn testing.so anybody plz hep mi wat'll b thr in testing n which is da best institute n how r da job opprtunities right now coz ppl r telling mi thr is sum down trend in sw now, so how much it is appropriate 2 take da course now. thankz in aadv
How does winrunner Recognize Objects in an application?
What different actions are performed by find and show button?
Where do you found that you can't use winrunner for automation?
Where exactly testing comes in to picture in S.D.L.C?
how to invoke the window based application in win runner
What is the use of Merge option provided in WR
What is database check points? how many types are there?Explain?
Can anyone explain me abt Winrunner Automation framework in detail and what r the steps involved in it
What is the Winrunner Framework in your organisation?
what is the use of Step into option provided in WR?
Will TSL supports function overloading and operator overloading?