How can we run SQLPLUS via gradle

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can we run SQLPLUS via gradle

shano.shanmugalingm
Hi,

Is there a way to run SQLPLUS directly from build.gradle file.

I created a custom task, and added the following;

        def db = [un : 'system', pw :'password',tns :'//localhost:1521/xe']
        def sqlplus= """sqlplus ${db.un}/${db.pw}@${db.tns} @script.sql""".execute()
       
        sqlplus.in.eachLine { line -> println line }

this, task gets executed successfully.  But It never quits SQLPLUS and keeps waiting.  I tried out different things posted in the web, and nothing seems to work.  Appreciate if some one could provide me a solution to come out of this.
Reply | Threaded
Open this post in threaded view
|

Re: How can we run SQLPLUS via gradle

Philippe Lhoste
On 13/10/2011 15:03, shano.shanmugalingm wrote:

> Is there a way to run SQLPLUS directly from build.gradle file.
>
> I created a custom task, and added the following;
>
> def db = [un : 'system', pw :'password',tns :'//localhost:1521/xe']
> def sqlplus= """sqlplus ${db.un}/${db.pw}@${db.tns}
> @script.sql""".execute()
>
> sqlplus.in.eachLine { line ->  println line }
>
> this, task gets executed successfully.  But It never quits SQLPLUS and keeps
> waiting.  I tried out different things posted in the web, and nothing seems
> to work.  Appreciate if some one could provide me a solution to come out of
> this.

Well, since I don't what you tried already...
I haven't tried with Gradle, but I had to automate some SQLPLUS tasks and I exit it by
putting a simple
EXIT
at the end of the list of commands. Does it work for you?

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How can we run SQLPLUS via gradle

Magnus Rundberget-3
In reply to this post by shano.shanmugalingm
I've been using this ant task lib with success for sqlplus stuff
http://incanto.sourceforge.net/usage-sqlplus.html

mvh Magnus

________________________

On 2011-10-13 16:22:14 +0000 shano.shanmugalingm <[hidden email]> wrote:

>
> Hi,
>
> Is there a way to run SQLPLUS directly from build.gradle file.
>
> I created a custom task, and added the following;
>
> def db = [un : 'system', pw :'password',tns :'//localhost:1521/xe']
> def sqlplus= """sqlplus ${db.un}/${db.pw}@${db.tns}
> @script.sql""".execute()
>
> sqlplus.in.eachLine { line -> println line }
>
> this, task gets executed successfully.  But It never quits SQLPLUS and keeps
> waiting.  I tried out different things posted in the web, and nothing seems
> to work.  Appreciate if some one could provide me a solution to come out of
> this.
>
>
> --
> View this message in context:
> http://gradle.1045684.n5.nabble.com/How-can-we-run-SQLPLUS-via-gradle-tp4899147p4899147.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email