Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef OCIPL_NO_COMMENT
00043 #define OCIPL_NO_COMMENT // no #pragma comment(lib, ...) statements in .lib files
00044 #endif
00045 #ifndef XS_NO_COMMENT
00046 #define XS_NO_COMMENT // no pragma(lib) in xmlstorage.h
00047 #endif
00048
00049 #include <xmlstorage.h>
00050 using namespace XMLStorage;
00051
00052 #ifdef UNICODE
00053 #define ANSI_STRING(s) XS_String(s)
00054 #else
00055 #define ANSI_STRING(s) s
00056 #endif
00057
00058 #include <iostream>
00059 using namespace std;
00060
00061 #include <time.h>
00062
00063 #include "ocipl.h"
00064
00065
00066 namespace OCIPL {
00067
00068
00069 void SqlStatement::dump_results(XMLPos& pos, const XS_String& element_name)
00070 {
00071 if (!(_state & EXECUTED))
00072 execute();
00073
00074 for(ResultIterator it(*this); it.has_next(); ++it) {
00075 pos.create(element_name);
00076
00077 _res->dump_values(pos, it);
00078
00079 pos.back();
00080 }
00081 }
00082
00083 void SqlStatement::dump_results(XMLWriter& writer, const XS_String& element_name)
00084 {
00085 if (!(_state & EXECUTED))
00086 execute();
00087
00088 for(ResultIterator it(*this); it.has_next(); ++it) {
00089 writer.create(element_name);
00090
00091 _res->dump_values(writer, it);
00092
00093 writer.back();
00094 }
00095 }
00096
00097
00098 void SqlRecord::dump_values(XMLPos& pos, int row)
00099 {
00100 ColumnVector::const_iterator it_type = _values.begin();
00101
00102 for(ColumnVector::const_iterator it=_values.begin(); it!=_values.end(); ++it,++it_type)
00103 pos[it->_type._name] = it->_pvar->str(row, _env._errh);
00104 }
00105
00106 void SqlRecord::dump_values(XMLWriter& writer, int row)
00107 {
00108 ColumnVector::const_iterator it_type = _values.begin();
00109
00110 for(ColumnVector::const_iterator it=_values.begin(); it!=_values.end(); ++it,++it_type)
00111 writer[it->_type._name] = it->_pvar->str(row, _env._errh);
00112 }
00113
00114
00115 }