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 |
I want to know is there any latest Win Runner Technology? If then plz tell me in detail. Thanks
list out the some of the exceptions list usually occur while recording and playing the script.
tell me the detailed exaplanation of different types of tesiting
what is the main diff of Qtp9.2 and 9.5 plz tell me
Wat is the defferances between Test plan and devolopment plan?
what is the use of _set_window in winrunner?
what is the regular expression for dd-mm-yyyy?
can anybody please send me important scripts in qtp
Where did you learn winrunner and testdirector?
What are data driven tests?
Is 'public' allowed inside of the function declarations?
What are the functions generate when u use GUI Check point?give me some of ones?