Robot - Excel
I am new to the rational robot but do know the basics. I have to code for the below functionality. Please suggest me how to go about it.
1. Read from excel data then
2. Insert in to database
3. Query the same data from database and compare with excel data.
Basically I want to insert the data from excel and want to verify the same using the script.
I see the code for reading from excel but would like to know how to insert and compare it. Do i need to store in to array for comparison or can directly compare with the excel data.
Which one is the cloest scripting language that I can learn for rational is it VBA or VBscript ?
Please help me out.
Re: Robot - Excel
Search the forum. plenty of posts discussed this
Re: Robot - Excel
If you have rights to the database, you can execute SQL queries with Robot. One of the easiest ways is to use the SQLRequest command (look it up in the help file). Itíll open a connection to the database, run a query, store any results into a given array, and close the database connection in one command. If youíre only hitting the DB twice (once to insert, then again to retrieve), this command should work just fine. Itíll store your results in a mutli-dimensional array, so make sure that the array you pass in is big enough. With the results in the array, you can compare the results with your Excel data.
If you plan on hitting the database repeatedly within the same script, I would recommend using a series of commands: SQLOpen, SQLExecQuery, SQLRequest, SQLRetrieve (if you want to store your results in an array), SQLRetrieveToFile (if you want to store your results in a file), and SQLClose. Using these commands, you can hit the database multiple times on the same connection instead of opening and closing connections multiple times in a single script. You also have the option of saving your query results to a file instead of an array, if thatís your preference. Further explanations of these methods should be in Robotís SQABasic Reference file.
As far as what scripting language you should learn, I would recommend VBA over VBScript, however, SQABasic is closer to plain old VB (pre-.NET).
Hope this helps.