extra_msg =
"Table Name: "+
table_name;
86 stringerr_message =
"bcp_init failed."+
GetDbgInfo();
103 intbcp_datatype = 0;
121 if(
static_cast<const CDB_String&
>(param).GetBulkInsertionEnc()
123bcp_datatype = SQLCHARACTER;
125bcp_datatype = SQLNCHAR;
159bcp_datatype = SQLDATETIME2N;
163 if(
static_cast<const CDB_Text&
>(param).GetEncoding()
167bcp_datatype = SQLNTEXT;
173bcp_datatype = SQLCHARACTER;
175bcp_datatype = SQLNCHAR;
201bulk_enc =
static_cast<const CDB_String&
>(param).GetBulkInsertionEnc();
204bulk_enc =
static_cast<const CDB_Text&
>(param).GetEncoding();
207bulk_enc =
static_cast<const CDB_VarCharMax&
>(param).GetEncoding();
225bulk_enc =
static_cast<const CDB_String&
>(param).GetBulkInsertionEnc();
228bulk_enc =
static_cast<const CDB_Text&
>(param).GetEncoding();
231bulk_enc =
static_cast<const CDB_VarCharMax&
>(param).GetEncoding();
363 if(
val.IsNULL()) {
364 data.assign(
static_cast<char*
>(
pb), 0);
366 val.GetBulkInsertionData
372 if(
val.IsNULL()) {
374}
else if(bcp_getcolfmt(
GetHandle(),
i+ 1, BCP_FMT_DATA_LEN,
375&length,
sizeof(length), &
dummy)
376==
FAIL|| length < 0) {
378}
else if(
static_cast<SIZE_TYPE>(length) >
data.size()) {
381length =
data.size();
442DBDATETIM4* dt = (DBDATETIM4*)
pb;
449 pb= (
void*) (dt + 1);
455 if(
val.IsNULL()) {
469 pb= (
void*) (dt + 1);
472 #if defined(SQLDATETIME2N) 479dt->
day=
lt.Day();
488 pb= (
void*) (dt + 1);
495 if(
val.IsNULL()) {
536 charparam_buff[2048];
540 stringerr_message =
"Cannot assign params."+
GetDbgInfo();
549 stringerr_message =
"bcp_sendrow failed."+
GetDbgInfo();
570 size_tleft_bytes =
val.Size();
572 size_tvalid_len = 0;
573 size_tinvalid_len = 0;
576invalid_len =
len- valid_len;
578 if(valid_len <
len) {
579 memmove(buff, buff + valid_len, invalid_len);
582 len=
val.Read(buff + invalid_len,
sizeof(buff) - invalid_len)
584 if(
len> left_bytes) {
595(
LPCBYTE)
static_cast<const char*
>(odbc_str)
601 string(
"bcp_moretext for ")
610left_bytes -= valid_len;
611}
while(left_bytes);
static const void * x_GetDataPtr(EDB_Type type, void *pb)
virtual ~CODBC_BCPInCmd(void)
CODBC_BCPInCmd(CODBC_Connection &conn, SQLHDBC cmd, const string &table_name)
static const void * x_GetDataTerminator(const CDB_Object ¶m)
static size_t x_GetDataTermSize(const CDB_Object ¶m)
virtual bool Send(void)
Send command to the server.
SQLHDBC GetHandle(void) const
virtual bool EndBCP(void)
Complete the BCP and store all rows transferred in last batch into the table.
virtual bool CommitBCPTrans(void)
Complete batch â to store all rows transferred by far in this batch into the table.
virtual bool Cancel(void)
Cancel the command execution.
static size_t x_GetBCPDataSize(EDB_Type type)
static int x_GetBCPDataType(const CDB_Object ¶m)
virtual int RowCount(void) const
Get the number of rows affected by the command Special case: negative on error or if there is no way ...
bool x_AssignParams(void *p)
virtual bool Bind(unsigned int column_num, CDB_Object *param_ptr)
const CODBC_Connection::TDbgInfo & GetDbgInfo(void) const
bool IsMultibyteClientEncoding(void) const
EEncoding GetClientEncoding(void) const
void SetDbgInfo(const string &msg)
CODBC_Connection & GetConnection(void)
void ReportErrors(void) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
virtual void SetHasFailed(bool flag=true)
const CDB_Params & GetBindParamsImpl(void) const
void DetachInterface(void)
void SetWasSent(bool flag=true)
void DropCmd(impl::CCommand &cmd)
CDB_Object * GetParam(unsigned int param_no) const
bool BindParam(unsigned int param_no, const string ¶m_name, CDB_Object *param, bool is_out=false)
TStatus GetParamStatus(unsigned int param_no) const
unsigned int NofParams() const
static CS_CONNECTION * conn
struct parameters_t * pb[]
static const char table_name[]
#define DATABASE_DRIVER_ERROR(message, err_code)
static bool IsBlobType(EDB_Type db_type)
static EBlobType GetBlobType(EDB_Type db_type)
virtual EDB_Type GetType() const =0
static const char * GetTypeName(EDB_Type db_type, bool throw_on_unknown=true)
#define NCBI_CURRENT_FUNCTION
Get current function name.
#define NCBI_CATCH_ALL_X(err_subcode, message)
uint8_t Uint1
1-byte (8-bit) unsigned integer
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
const char *const kEmptyCStr
Empty "C" string (points to a '\0').
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
RETCODE bcp_bind(DBPROCESS *dbproc, BYTE *varaddr, int prefixlen, DBINT varlen, BYTE *terminator, int termlen, int db_vartype, int table_column)
Bind a program host variable to a database column.
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
RETCODE bcp_init(DBPROCESS *dbproc, const char *tblname, const char *hfile, const char *errfile, int direction)
Prepare for bulk copy operation on a table.
RETCODE bcp_collen(DBPROCESS *dbproc, DBINT varlen, int table_column)
Set the length of a host variable to be written to a table.
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition of all error codes used in dbapi libraries (dbapi_driver.lib and others).
SIZE_TYPE GetValidUTF8Len(const CTempString &ts)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
#define DBDATETIME4_mins(x)
SQL_SS_TIMESTAMPOFFSET_STRUCT DBTIMESTAMP
#define DBDATETIME4_days(x)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4