SQL Relay C++ API
|
#include <sqlrexportxml.h>
Inherits sqlrexportfile.
Public Member Functions | |
sqlrexportxml () | |
virtual | ~sqlrexportxml () |
virtual bool | exportData () |
Public Member Functions inherited from sqlrexportfile | |
sqlrexportfile () | |
virtual | ~sqlrexportfile () |
void | setFileName (const char *filename) |
const char * | getFileName () |
Public Member Functions inherited from sqlrexport | |
sqlrexport () | |
virtual | ~sqlrexport () |
void | setSqlrConnection (sqlrconnection *sqlrcon) |
void | setSqlrCursor (sqlrcursor *sqlrcur) |
sqlrconnection * | getSqlrConnection () |
sqlrcursor * | getSqlrCursor () |
void | setTable (const char *table) |
const char * | getTable () |
void | setExcludeColumns (bool excludecolumns) |
bool | getExcludeColumns () |
void | setColumnsToExclude (const char *const *columnstoexclude) |
const char *const * | getColumnsToExclude () |
void | setLogger (logger *lg) |
logger * | getLogger () |
void | setCoarseLogLevel (uint8_t coarseloglevel) |
uint8_t | getCoarseLogLevel () |
void | setFineLogLevel (uint8_t fineloglevel) |
uint8_t | getFineLogLevel () |
void | setLogIndent (uint32_t logindent) |
uint32_t | getLogIndent () |
void | setLogErrors (bool logerrors) |
bool | getLogErrors () |
uint64_t | getExportedRowCount () |
Additional Inherited Members | |
Protected Member Functions inherited from sqlrexportfile | |
void | setFileDescriptor (filedescriptor *fd) |
filedescriptor * | getFileDescriptor () |
Protected Member Functions inherited from sqlrexport | |
virtual bool | exportStart () |
virtual bool | columnsStart () |
virtual bool | columnStart () |
virtual bool | columnEnd () |
virtual bool | columnsEnd () |
virtual bool | rowsStart () |
virtual bool | rowStart () |
virtual bool | fieldStart () |
virtual bool | fieldEnd () |
virtual bool | rowEnd () |
virtual bool | rowsEnd () |
virtual bool | beginStart () |
virtual bool | beginEnd () |
virtual bool | commitStart () |
virtual bool | commitEnd () |
virtual bool | error (int64_t errornumber, const char *errormessage) |
virtual bool | exportEnd () |
void | setExcludeRow (bool excluderow) |
bool | getExcludeRow () |
void | setCurrentRow (uint64_t currentrow) |
uint64_t | getCurrentRow () |
void | setCurrentColumn (uint32_t currentcol) |
uint32_t | getCurrentColumn () |
void | setCurrentColumnName (const char *currentcolname) |
const char * | getCurrentColumnName () |
void | setCurrentField (const char *currentfield) |
const char * | getCurrentField () |
void | setIsNumericColumn (uint64_t index, bool numeric) |
bool | getIsNumericColumn (uint64_t index) |
void | clearAreNumericColumns () |
void | setExportedRowCount (uint64_t exportedrowcount) |
The sqlrexportxml class implements sqlrexport for XML files.
sqlrexportxml::sqlrexportxml | ( | ) |
Creates an instance of the sqlrexportxml class.
|
virtual |
Destroys this instance of the sqlrexportxml class.
|
virtual |
Exports the result set of the cursor currently in use as set by the most recent call to setSqlrCursor() to the file set by the most recent call to setFileName(), or to standard output if setFileName() was never called, or if setFileName(NULL) was called.
If setTable() was called with a non-null value then the table name is included as the "name" attribute of the table tag. If setTable() was never called, or setTable(NULL) was called, then the name attribute is omitted.
The XML format is as follows: (This example is a table of US states, exported from PostgreSQL)
<?xml version="1.0"?>
<column name="state_id" type="int4"> <column name="state_name" type="varchar"> <column name="state_abbreviation" type="varchar"> <column name="latitude" type="numeric"> <column name="longitude" type="numeric"> <column name="creation_date" type="date"> </columns> <rows> <row> <field>1</field> <field>Louisiana</field> <field>LA</field> <field>31.259800</field> <field>-92.658700</field> <field>2005-08-16</field> </row> <row> <field>2</field> <field>Texas</field> <field>TX</field> <field>31.653400</field> <field>-100.546900</field> <field>2005-08-17</field> </row> <row> <field>3</field> <field>Georgia</field> <field>GA</field> <field>32.750300</field> <field>-83.737800</field> <field>2005-08-16</field> </row> </rows>
Returns true on success and false if an error occurred.
Reimplemented from sqlrexportfile.