#include <dbexport.h>
Public Types | |
enum | SuppressionMode { SUPPRESS_NONE = 0, SUPPRESS_TABLENAME = 1, SUPPRESS_COLUMNNAMES = 2 } |
What header lines want supressing. More... | |
enum | TextConversionMode { NO_CONVERT = 0, CONVERT_NORMAL, CONVERT_TO_QE } |
How shall we deal with control characters. More... | |
Public Methods | |
DbExport (const LookString &theTableName) | |
Constructor. More... | |
~DbExport () | |
Destructor. | |
void | AddOtherTable (const LookString &theTableName) |
Add another table for the select. More... | |
void | SetWhereClause (const LookString &theWhereClause) |
Set a where clause. More... | |
void | SetOrderClause (const LookString &theOrderClause) |
Set an order clause. More... | |
void | SetFloatPrecision (int thePrecision) |
Set the floating point precision. More... | |
void | SetSuppressionMode (int theSuppressionMode) |
Set header lines suppression. | |
void | SetNULLString (const LookString &theString) |
Set string to use as NULL marker (default is "]^NULL^["). | |
void | SetTextConversionMode (TextConversionMode theConversionMode) |
Set control character conversion mode. | |
void | SetDOSLineEnds (bool useCRLF) |
bool | DoExport (const LookString &theFileName) |
Actually do the export. More... | |
long | GetNRowsExported (void) |
How many rows were exported? | |
Protected Methods | |
LookString | GenerateSelectString (void) |
LookString | GetExportString (const DbField *theField) |
Protected Attributes | |
LookString | itsTableName |
LookStringList | itsOtherTables |
LookString | itsWhereClause |
LookString | itsOrderClause |
int | itsFloatPrecision |
bool | itHasFloatPrecision |
int | itsHeaderSuppressionMode |
TextConversionMode | itsTextConversionMode |
LookString | itsNULLString |
LookString | itsLFString |
DbDescribeTable::ColumnInfoList | itsTableColumns |
long | itsNRowsExported |
As such, it might not belong here. The intention was to allow other things (eg applications) use the import/export.
This creates a file and puts some data in it. The basic file format is
TABLENAME\tSQL statement Col1\tcol2\tcol3 r1c1\tr1c2\tr1c3 r2c1\tr2c2\tr2c3
where \t means 'tab'. It is in unix form, ie lines separated by \n.
This is configurable to an extent.
The manual page for dbexport explains quite a lot.
|
What header lines want supressing. These can be ORed together. If you do suppress any of the header lines, dbimport won't be able to read the file again. |
|
How shall we deal with control characters. If you use NO_CONVERT, dbimport may not be able to read the file. |
|
Constructor. This doesn't actually do anything except set up the table name.
|
|
Add another table for the select. If you want to do a join in the select statement used for the export, you'll need to add in the table too for the from clause.
|
|
Actually do the export. Set up everything else first!
|
|
|
|
Set the floating point precision.
|
|
Set an order clause. Note that on some databases the order by needs to be in the select list, and so you can't use it.
|
|
Set a where clause.
|