How to Get data from database(table) to an excel sheet
Answer Posted / naga chiranjeevi kota
Session="mysession";
connstring="DSN=DQMCHIRU;UID=dqm5map;pwd=dqm5map;server=Orcl";
rc=db_connect(Session,connstring);
x="select PART_NUM,PART_ORG ,RDX_ID,DESCRIPTION from
reference_data_part where part_num like '%31' order by
PART_NUM";
printf(x);
# Opening the excel sheet
dqmdata = "C:\ExecuteSampleData.xls";
rc = ddt_open(dqmdata, DDT_MODE_READWRITE);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
dc=db_execute_query(Session,x,rows);
#ddt_get_row_count(dqmdata,rows);
for(i=0;i<rows;i++)
{
db_get_row(Session,i,rowcon);
#ddt_set_row(dqmdata,i);
split(rowcon,rdp,"\t");
for(j=0;j<4;j++)
{
printf("R"&i+1&", C"&j+1&": "&rdp[j+1]);
ddt_set_val_by_row(dqmdata,i+1,"C"&(j+1),rdp[j+1]);
}
}
db_disconnect(Session);
ddt_save(dqmdata);
ddt_close(dqmdata);
answer by: Naga Chiranjeevi Kota(iGATE)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the purpose of different record methods 1) record 2) pass up 3) as object 4) ignore.
what is mean by release in quality center and who will perfom?
How do you handle dynamically changing area of the window in the bitmap checkpoints?
How do you suppress a regular expression?
How do u check FONTS in Login Window?
What is the purpose of regexp_label property?
Explain difference between winrunner and test director?
i this is priya speaking, any 1 tell me project detail for NETBANKING and HELTHCARE pls send to this E-MAIL ADDRESS; (priyadharshni2@yahoo.com)pls qik, thank u once agajn.
How do you find an object in an gui map.
How do you filter the objects in the gui map?
How do you identify which files are loaded in the gui map?
What are the synchronization points?
can i get apex technologies interview questions in testing
what are the differences you see in e-commerce and banking domain in testing point of view Thanks in Advance
What Framework is suitable to validate the Login screen.