You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Pawanraj Sadhwani <pa...@elitecore.com> on 2004/05/14 14:19:54 UTC

SQL Command Output?

I am using the sql task of ant. working with ant 1.6.1

the task is

<target name="sql-test">
  <sql driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@192.168.1.66:1521:ora92" 
       userid="scott" password="tiger"  autocommit="true"
       src="mycommands.sql" output="sql-result.txt" append="true"
       classpathref="lib.class.path" />
</target>

The build is successful, and commands are successfully executed too. The problem is that no output is shown on sql-result.txt.

My mycommands.sql is as below

-- this is a comment
select * from staff;

-- now an insert
insert into staff values('USR0000005', 'pawan', 'STF0000007');

What am i doing wrong?

Pawan


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: SQL Command Output?

Posted by Pawanraj Sadhwani <pa...@elitecore.com>.
Hi All,

Just one more question. With every operation on the database, the output file includes the header and the trailer 
( saying 0 rows affected and so on)

While there is an option to suppress header.. is there a way to supress trailer also?

Pawan

-----Original Message-----
From: Pawanraj Sadhwani [mailto:pawanraj@elitecore.com]
Sent: Friday, May 14, 2004 7:06 PM
To: 'Ant Users List'
Subject: RE: SQL Command Output?


thanx rhino.. works nicely

-----Original Message-----
From: Rhino [mailto:rhino1@sympatico.ca]
Sent: Friday, May 14, 2004 6:59 PM
To: Ant Users List; pawanraj@elitecore.com
Subject: Re: SQL Command Output?


Add this to the parameters for your sql task: print="yes".

Without this parameter, your output file is created but is empty.

Rhino

----- Original Message ----- 
From: "Pawanraj Sadhwani" <pa...@elitecore.com>
To: "'Ant Users List'" <us...@ant.apache.org>
Sent: Friday, May 14, 2004 8:19 AM
Subject: SQL Command Output?


I am using the sql task of ant. working with ant 1.6.1

the task is

<target name="sql-test">
  <sql driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@192.168.1.66:1521:ora92"
       userid="scott" password="tiger"  autocommit="true"
       src="mycommands.sql" output="sql-result.txt" append="true"
       classpathref="lib.class.path" />
</target>

The build is successful, and commands are successfully executed too. The
problem is that no output is shown on sql-result.txt.

My mycommands.sql is as below

-- this is a comment
select * from staff;

-- now an insert
insert into staff values('USR0000005', 'pawan', 'STF0000007');

What am i doing wrong?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: SQL Command Output?

Posted by Pawanraj Sadhwani <pa...@elitecore.com>.
thanx rhino.. works nicely

-----Original Message-----
From: Rhino [mailto:rhino1@sympatico.ca]
Sent: Friday, May 14, 2004 6:59 PM
To: Ant Users List; pawanraj@elitecore.com
Subject: Re: SQL Command Output?


Add this to the parameters for your sql task: print="yes".

Without this parameter, your output file is created but is empty.

Rhino

----- Original Message ----- 
From: "Pawanraj Sadhwani" <pa...@elitecore.com>
To: "'Ant Users List'" <us...@ant.apache.org>
Sent: Friday, May 14, 2004 8:19 AM
Subject: SQL Command Output?


I am using the sql task of ant. working with ant 1.6.1

the task is

<target name="sql-test">
  <sql driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@192.168.1.66:1521:ora92"
       userid="scott" password="tiger"  autocommit="true"
       src="mycommands.sql" output="sql-result.txt" append="true"
       classpathref="lib.class.path" />
</target>

The build is successful, and commands are successfully executed too. The
problem is that no output is shown on sql-result.txt.

My mycommands.sql is as below

-- this is a comment
select * from staff;

-- now an insert
insert into staff values('USR0000005', 'pawan', 'STF0000007');

What am i doing wrong?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: SQL Command Output?

Posted by Rhino <rh...@sympatico.ca>.
Add this to the parameters for your sql task: print="yes".

Without this parameter, your output file is created but is empty.

Rhino

----- Original Message ----- 
From: "Pawanraj Sadhwani" <pa...@elitecore.com>
To: "'Ant Users List'" <us...@ant.apache.org>
Sent: Friday, May 14, 2004 8:19 AM
Subject: SQL Command Output?


I am using the sql task of ant. working with ant 1.6.1

the task is

<target name="sql-test">
  <sql driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@192.168.1.66:1521:ora92"
       userid="scott" password="tiger"  autocommit="true"
       src="mycommands.sql" output="sql-result.txt" append="true"
       classpathref="lib.class.path" />
</target>

The build is successful, and commands are successfully executed too. The
problem is that no output is shown on sql-result.txt.

My mycommands.sql is as below

-- this is a comment
select * from staff;

-- now an insert
insert into staff values('USR0000005', 'pawan', 'STF0000007');

What am i doing wrong?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org