History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-1108
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: Dierk Koenig
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
groovy

provide GString versions for Sql.rows and Sql.firstRow() [minor breaking change]

Created: 01/Nov/05 01:12 PM   Updated: 08/Feb/08 01:26 AM
Component/s: SQL processing
Affects Version/s: 1.0-JSR-3
Fix Version/s: 1.5.2

Time Tracking:
Not Specified


 Description  « Hide
provide

groovy.sql.Sql.rows(GString)
groovy.sql.Sql.firstRow(GString)

analogous to
eachRow and query



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King - 06/Jan/08 01:43 AM
Added. Just a note for existing users of the String versions of the rows() and firstRow() methods. If you are using GStrings with the String versions of these methods, you may need to add ".toString()" to your GStrings otherwise you may experience wierd behavior. E.g. if you have something like:
def table = 'PERSON'
GString query = "select * from $table"
def result = sql.rows(query)

The query will be passed looking for parameters and be changed to:

select * from ?

If you want to keep using the GString, just change the last line to:

def result = sql.rows(query.toString())

Paul King - 08/Feb/08 01:26 AM
close off release 1.5.4