0
votes

I have cygwin installed on a remote windows server running oracle. I am trying to run sqlplus through an ANT file in Jenkins. I use sshexec to run the command below, but it doesn't work.

I am able to make it work when I login into SSH then first type in 'cmd' to switch to the windows command prompt, then entering the sqlplus statement below is successfull.

How can I replicate the above using scripts by running the sqlplus command below in cmd.exe or run cmd.exe first then execute the sqlplus command so it works like when I perform it directly in SSH.

<target name="compile.data">


<sshexec host="${ssh.hostname}"
verbose="true"
trust="true"
username="${ssh.username}"
password="${ssh.username}"
command="sqlplus ${db.username}/${db.password}@${db.hostname}:${db.port}:${db.sid} @${script.path}testscript.sql"/>
             
         
</target>

Thanks.

1

1 Answers

0
votes

I have found the answer after to my question for refernce:

<sshexec host="${ssh.hostname}"
verbose="true"
trust="true"
username="${ssh.username}"
password="${ssh.username}"
command='cmd /C "sqlplus ${db.username}/${db.password}@${db.hostname}:${db.port}:${db.sid} @${script.path}testscript.sql"'/>