SQL Relay C++ API
|
#include <sqlrimportcsv.h>
Inherits sqlrimportfile, and csvsax.
Public Member Functions | |
sqlrimportcsv () | |
virtual | ~sqlrimportcsv () |
virtual bool | importData () |
Public Member Functions inherited from sqlrimportfile | |
sqlrimportfile () | |
virtual | ~sqlrimportfile () |
void | setFileName (const char *filename) |
const char * | getFileName () |
bool | importData () |
Public Member Functions inherited from sqlrimport | |
sqlrimport () | |
virtual | ~sqlrimport () |
void | setSqlrConnection (sqlrconnection *sqlrcon) |
void | setSqlrCursor (sqlrcursor *sqlrcur) |
sqlrconnection * | getSqlrConnection () |
sqlrcursor * | getSqlrCursor () |
void | insertPrimaryKey (const char *primarykeycolumnname, uint32_t primarykeycolumnindex, const char *primarykeysequence) |
void | removePrimaryKey () |
bool | getInsertPrimaryKey () |
const char * | getPrimaryKeyColumnName () |
uint32_t | getPrimaryKeyColumnIndex () |
const char * | getPrimaryKeySequence () |
void | insertStaticValue (const char *columnname, uint32_t columnindex, const char *value) |
void | removeStaticValue (uint32_t columnindex) |
const char * | getStaticValueColumnName (uint32_t index) |
const char * | getStaticValue (uint32_t index) |
uint32_t | getStaticValueCount () |
void | setDbType (const char *dbtype) |
const char * | getDbType () |
void | setObjectName (const char *objectname) |
const char * | getObjectName () |
void | setIgnoreColumns (bool ignorecolumns) |
bool | getIgnoreColumns () |
void | setIgnoreColumnsWithEmptyNames (bool ignorecolumnswithemptynames) |
bool | getIgnoreColumnsWithEmptyNames () |
void | setIgnoreEmptyRows (bool ignoreemptyrows) |
bool | getIgnoreEmptyRows () |
void | mapColumnName (const char *from, const char *to) |
const char * | getMappedColumnName (const char *from) |
void | setMixedCaseColumnNames () |
bool | getMixedCaseColumnNames () |
void | setLowerCaseColumnNames () |
bool | getLowerCaseColumnNames () |
void | setUpperCaseColumnNames () |
bool | getUpperCaseColumnNames () |
void | mapFieldValue (const char *from, const char *to) |
const char * | getMappedFieldValue (const char *from) |
void | setReformatDateTime (bool reformatdatetime) |
bool | getReformatDateTime () |
void | setDdMm (bool ddmm) |
bool | getDdMm () |
void | setYyyyDdMm (bool yyyyddmm) |
bool | getYyyyDdMm () |
void | setDateDelimiters (const char *datedelimiters) |
const char * | getDateDelimiters () |
void | setNoCenturyThreshold (uint16_t nocenturythreshold) |
uint16_t | getNoCenturyThreshold () |
void | setLastCenturyThreshold (uint16_t lastcenturythreshold) |
uint16_t | getLastCenturyThreshold () |
void | setDateTimeFormat (const char *datetimeformat) |
const char * | getDateTimeFormat () |
void | setCommitCount (uint64_t commitcount) |
uint64_t | getCommitCount () |
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 | getImportedRowCount () |
Additional Inherited Members | |
Protected Member Functions inherited from sqlrimportfile | |
void | setFileDescriptor (filedescriptor *fd) |
filedescriptor * | getFileDescriptor () |
Protected Member Functions inherited from sqlrimport | |
virtual bool | importStart () |
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 | importEnd () |
void | setExcludeRow (bool excluderow) |
bool | getExcludeRow () |
void | setCurrentRow (uint64_t currentrow) |
uint64_t | getCurrentRow () |
void | setCurrentColumn (uint32_t currentcol) |
uint32_t | getCurrentColumn () |
void | setCurrentColumnName (char *currentcolname) |
char * | getCurrentColumnName () |
void | setCurrentField (char *currentfield) |
char * | getCurrentField () |
void | setIsNumericColumn (uint64_t index, bool numeric) |
bool | getIsNumericColumn (uint64_t index) |
void | clearAreNumericColumns () |
void | setIsDateTimeColumn (uint64_t index, bool datetime) |
bool | getIsDateTimeColumn (uint64_t index) |
void | clearAreDateTimeColumns () |
void | setImportedRowCount (uint64_t importedrowcount) |
The sqlrimportcsv class implements sqlrimport for CSV files.
sqlrimportcsv::sqlrimportcsv | ( | ) |
Creates an instance of the sqlrimportcsv class.
|
virtual |
Destroys this instance of the sqlrimportcsv class.
|
virtual |
Imports data from the file set by the most recent call to setFileName(). The table (or sequence) to import the data into will be derived from the import file name, and may be overridden using setObjectName().
If setCommitCount() was called with a non-zero value then a commit will be called after every "commitcount" rows is inserted. No commit will be called if setCommitCount() was never called, or if setCommitCount(0) was called.
Returns true on success and false if an error occurred.
Reimplemented from sqlrimport.