Discussion:
[groovy-dev] Re: groovy sql with separate script library
bartoleo
2015-02-23 19:58:37 UTC
Permalink
you can do:
sql.eachRow( new File("c:\\groovyScripts\\sql01.sql".text }

2015-02-23 20:20 GMT+01:00 dainova [via Groovy] <
Hi, all
I'm new to groovy, and trying to implement architecture in our new test
framework for sql (MS SQL).
I played with scripts and see how easy to get results from running query
like below, but I wanted to learn
how I can tell groovy sql connector to run sql from separate library
within file system.
Idea here is to have single connector and run multiple scripts which can
be maintained separately from groovy.
All scripts will be run on same db, but in future I think we also will
want to put all connection params in varaiable too.
Thanks so much
Mario
sql.eachRow( 'select * from tableName' ) { println "$it.id --
${it.firstName} --" }
sql.eachRow( source(c:/groovyScripts/sql01.sql } -- something
like this
------------------------------
If you reply to this email, your message will be added to the discussion
http://groovy.329449.n5.nabble.com/groovy-sql-with-separate-script-library-tp5722796.html
To start a new topic under groovy - dev, email
To unsubscribe from Groovy, click here
<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=329449&code=YmFydG9sb2xlbzc0QGdtYWlsLmNvbXwzMjk0NDl8LTEwMTExMjkyMzk=>
.
NAML
<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
Leo Bartoloni

-----------------------------------------------------------------------------------------------------------------------------------------------------------
Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi
allegati Ú vietato e potrebbe costituire reato.
Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se
provvedesse alla distruzione dello stesso
e degli eventuali allegati.
Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non
siano relative alle attività e/o
alla missione aziendale. si intendono non attribuibili alla società stessa,
né la impegnano in alcun modo.




--
View this message in context: http://groovy.329449.n5.nabble.com/groovy-sql-with-separate-script-library-tp5722796p5722797.html
Sent from the groovy - dev mailing list archive at Nabble.com.
Loading...