Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-10
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
I want to add a "oneRow" method to the groovy.sql.Sql class.
So, instead of this :
answer = 0
sql.eachRow("select age from PERSON where firstName=James and lastName=Strachan") { row |
answer = row[0]
}
I could write something like :
result = sql.oneRow("select age from PERSON where firstName=James and lastName=Strachan").age
or like this :
result = sql.oneRow("select age from PERSON where firstName=James and lastName=Strachan")[0]
The patch i wrote to add the "oneRow" method.