[Ocipl-commits] SF.net SVN: ocipl: [47] trunk/ocipl
Brought to you by:
martinfuchs
|
From: <mar...@us...> - 2008-02-09 15:04:35
|
Revision: 47
http://ocipl.svn.sourceforge.net/ocipl/?rev=47&view=rev
Author: martinfuchs
Date: 2008-02-09 07:04:39 -0800 (Sat, 09 Feb 2008)
Log Message:
-----------
use ResultIterator for fetch loops
Modified Paths:
--------------
trunk/ocipl/ocipl-xml.cpp
trunk/ocipl/ocipl.cpp
Modified: trunk/ocipl/ocipl-xml.cpp
===================================================================
--- trunk/ocipl/ocipl-xml.cpp 2008-02-09 15:04:03 UTC (rev 46)
+++ trunk/ocipl/ocipl-xml.cpp 2008-02-09 15:04:39 UTC (rev 47)
@@ -2,9 +2,9 @@
//
// ocipl-xml.cpp
//
- // Copyright (c) 2003, 2004, 2005, 2006, 2007 Martin Fuchs <mar...@gm...>
+ // Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Martin Fuchs <mar...@gm...>
//
- // OCIPL Version 1.3
+ // OCIPL Version 1.4
//
/// \file ocipl-xml.cpp
@@ -71,14 +71,13 @@
if (!(_state & EXECUTED))
execute(); // instead of first_bulk()
- for(int fetched=fetched_rows(); fetched>0; fetched=next_bulk())
- for(int i=0; i<fetched; ++i) {
- pos.create(element_name);
+ for(ResultIterator it(*this); it.has_next(); ++it) {
+ pos.create(element_name);
- _res->dump_values(pos, i);
+ _res->dump_values(pos, it);
- pos.back();
- }
+ pos.back();
+ }
}
void SqlStatement::dump_results(XMLWriter& writer, const XS_String& element_name)
@@ -86,14 +85,13 @@
if (!(_state & EXECUTED))
execute();
- for(int fetched=fetched_rows(); fetched>0; fetched=next_bulk())
- for(int i=0; i<fetched; ++i) {
- writer.create(element_name);
+ for(ResultIterator it(*this); it.has_next(); ++it) {
+ writer.create(element_name);
- _res->dump_values(writer, i);
+ _res->dump_values(writer, it);
- writer.back();
- }
+ writer.back();
+ }
}
Modified: trunk/ocipl/ocipl.cpp
===================================================================
--- trunk/ocipl/ocipl.cpp 2008-02-09 15:04:03 UTC (rev 46)
+++ trunk/ocipl/ocipl.cpp 2008-02-09 15:04:39 UTC (rev 47)
@@ -1169,16 +1169,15 @@
int row_cnt = 0;
- for(int fetched=fetched_rows(); fetched>0; fetched=next_bulk())
- for(int i=0; i<fetched; ++i) {
- ++row_cnt;
+ for(ResultIterator it(*this); it.has_next(); ++it) {
+ ++row_cnt;
- out << _T("row ") << row_cnt << _T(":\n");
+ out << _T("row ") << row_cnt << _T(":\n");
- _res->print_values(out, i);
+ _res->print_values(out, it);
- out << _T("\n");
- }
+ out << _T("\n");
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|