How to Import(insert) data from an excel sheet to
Database(table).
Answer Posted / 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 View All Answers
Dear all i am new to testing my company using vb.net and we are developing web based application. How i can test those application with winrunner if any one have some good tutorial or link kindly provide thanks u.
Have you used winrunner in your project?
What different actions are performed by find and show button?
global sheet and external excel sheet how it will work
what are the differences you see in e-commerce and banking domain in testing point of view Thanks in Advance
How to to get the information from the status bar without doing any activity/click on the hyperlink?
How should we write and execute a user define function using WinRunner.
How can withwin runner to make single scripts which supports multiple languages?
How to force wr to learn the sub-items on a menu?
How do you load GUI map?
What are the synchronization points?
How to break infinite loop?
Name the different types of checkpoints?
What is toogle breakpoints? How does it differ from break points?
I want to do smoke test in my application but i have learnt the application before recording but im getting an error class name not found while running the script.I want to check each links and each text in my application. Can anybody answer my quesion plz.If it is possible i want test script for Yahoo login form with "New User" Login.