← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #653769]: How to run a executable query in Oracle -Sql Developer

 

Question #653769 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/653769

    Status: Open => Answered

Manfred Hampl proposed the following answer:
How do the contents of the excel file map to the elements of the line?

What does the excel cell contain? the EMP_ID or the EMP_NAME or the
complete line "917,'Muthu','Covai','PA','BE',21", or...?

You probably have to use string concatenation.
Assuming the following:
row 41 column 31 contains the EMP_ID
row 41 column 32 contains the EMP_NAME
row 41 column 33 contains the EMP_ADDRESS
etc.
Then the following should work
text_file.write("Insert into emp_details (EMP_ID,EMP_NAME,EMP_ADDRESS,DESIGNATION,QUALIFICATION,AGE) values ("+str(sheet.cell_value(40,30))+",'"+sheet.cell_value(40,31)+"','"+sheet.cell_value(40,32)+"','"+sheet.cell_value(40,33)+"','"+sheet.cell_value(40,34)+"',"+str(sheet.cell_value(40,35))+");")
You have to build a long string with contents that are very similar to the line that you created manually, containing quote and comma characters in the same sequence.

(Remark: check "string concatenation" in the python manuals)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.