sqldata/sqlpgapi.cpp
// Initialize the bulk copy from one database into another
Initialize the bulk copy from one database into another
Initialize the bulk copy from one database into another
int SqlPgApi::InitBulkTransfer(const char *table, size_t col_count, size_t , SqlCol * , SqlCol ** )
{
	std::string command = "COPY ";
	command += table;
	command += " FROM STDIN"; 
	_copy_cols_count = col_count;
	PGresult* result = _PQexec(_conn, command.c_str());
	if(_PQresultStatus(result) != PGRES_COPY_IN)
	{
		_PQclear(result);
		return -1;
	}
	_copy_data = new char[LIBPQ_COPY_DATA_BUFFER_LEN];
	_PQclear(result);
	return 0;
}
int SqlPgApi :: InitBulkTransfer ( const char * table , size_t col_count , size_t , SqlCol * , SqlCol * * ) { std :: string command = " " ; command += table ; command += " " ; _copy_cols_count = col_count ; PGresult * result = _PQexec ( _conn , command . c_str ( ) ) ; if ( _PQresultStatus ( result ) != PGRES_COPY_IN ) { _PQclear ( result ) ; return -1 ; } _copy_data = new char [ LIBPQ_COPY_DATA_BUFFER_LEN ] ; _PQclear ( result ) ; return 0 ; }
Initialize the bulk copy from one database into another
Initialize the bulk copy from one database into another
/*allocated_array_rows*/ /*s_cols*/ /*t_cols*/ // Execute COPY command 