Forum Discussion
tjdurden
13 years agoFrequent Contributor
Hi,
You could use a JDBC request, and then access the response using Groovy, or you could actually implement the JDBC request within a Groovy step iteself. There's various bits on the net, but to summarise (and I'm afraid I'm tapping this out quick, so forgive me, as it's untested/not checked for accuracy)....
1) JDBC Query using Groovy
Not for Oracle, but an example: http://stackoverflow.com/questions/4791 ... ovy-script
For Oracle... have a read of: viewtopic.php?f=2&t=3962
2) Writing to a file using Groovy
Hope this at least gives you some basic pointers.
Kind regards,
Tim
You could use a JDBC request, and then access the response using Groovy, or you could actually implement the JDBC request within a Groovy step iteself. There's various bits on the net, but to summarise (and I'm afraid I'm tapping this out quick, so forgive me, as it's untested/not checked for accuracy)....
1) JDBC Query using Groovy
Not for Oracle, but an example: http://stackoverflow.com/questions/4791 ... ovy-script
For Oracle... have a read of: viewtopic.php?f=2&t=3962
2) Writing to a file using Groovy
// After having retrieved a given value from SQL (or any other value)
// Let's just hold it in a var for the moment.
def myID = "12345";
// write to log, just for fun...
log.info myID;
// Create a text file
def outputFile = new File("C:\\myValues.txt")
// Write value to file
outputFile.write(myID)
Hope this at least gives you some basic pointers.
Kind regards,
Tim