skip to main
|
skip to sidebar
Groovy Scripting and Programming
Fun with the Groovy programming language and more
Saturday, May 1, 2010
Getting Groovy gStrings to work with sql queries
If you are building dynamic SQL queries with gstrings, you may have had issues embedding SQL date strings in them, the way I solved this was to explicitly define the query as a string:
date="{ts '2010-05-01 00:00:00'}"
String
query="""
SELECT
order_number
order_amount
FROM
orders
where
order_date >${date}
"""
sql.eachLine(query),{println it })
0 comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Programming Services Available
Get Web, Cloud, General Programming and IT Services from
Solutions4Tech
LinkedIn Profile
Blog Archive
►
2012
(1)
►
February
(1)
A Little Data Validation, Please?
►
2011
(8)
►
December
(1)
Fixing my foot wound
►
November
(2)
Shooting Myself in the Foot
7 Reasons Why I still like VI
►
September
(3)
Is Groovy Relevant Part Deux
This Years Resolutions
Is Groovy and Grails still relevant
►
July
(1)
C vs. Groovy
►
May
(1)
My Programming Toolbox
▼
2010
(6)
►
October
(1)
Meta Programming
▼
May
(1)
Getting Groovy gStrings to work with sql queries
►
March
(4)
The Ups and the Downs of the Groovy Console
Groovy File One Liners
Argh..Oracle has taken over the Java page
println("Hello World")
Links of Interest
Grails Website
Groovy Website
Java Dev Kit Download
NetBeans
No Fluff Just Stuff
Irunabiz Technology
Solutions4Tech
Cloud Read PC
Subscribe To
Posts
Atom
Posts
Comments
Atom
Comments
0 comments:
Post a Comment