Bug 27446 - Make <sql> task to suppress "N rows affected" messages
Summary: Make <sql> task to suppress "N rows affected" messages
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.1
Hardware: PC All
: P3 enhancement with 3 votes (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2004-03-04 17:53 UTC by Andriy Palamarchuk
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Palamarchuk 2004-03-04 17:53:04 UTC
I use <sql> output for further processing and need to have only results of SQL
statements without any additional messages. Headers are suppressed with
attribute "showheaders" but there is no way to remove "N rows affected" messages
after each executed statement.

Suggestion - introduce new attribute "showfooters" or "showaffected".

Thanks,
Andriy
Comment 1 Bret D Weinraub 2004-05-27 21:26:12 UTC
What point is the N rows affected anyway?  
Comment 2 Bret D Weinraub 2004-05-27 21:45:13 UTC
I wrote the code to fix this; but can't commit as I am not a committer.

As such I'm unassigning it from me.

Index: SQLExec.java
===================================================================
RCS 
file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
retrieving revision 1.67
diff -r1.67 SQLExec.java
135a136,140
>      * Print SQL results statistics (rows affected)
>      */
>     private boolean showfooters = null;
> 
>     /**
317a323,331
>      * Conditionally print the SQL "rows affected" line.
>      * @param showfooters if true prints the "rows affected" line
>      * @since Ant 1.6
>      */
> 
>     public void setShowfooters (boolean showfooters) {this.showfooters = 
showfooters;}
>     public boolean getShowfooters () {return showfooters;}
> 
>     /**
543c557
<             if (print) {
---
>             if (print && showfooters) {
545c559
<                 line.append(updateCountTotal + " rows affected");
---
>               line.append(updateCountTotal + " rows affected");
Comment 3 Kev Jackson 2006-02-06 06:20:46 UTC
I've added this property into the task now (in trunk/head).  property is
showtrailers