NCBI C++ ToolKit
Macros | Functions | Variables
bcp.c File Reference
#include "common.h"
#include "bcp.h"
#include <common/test_assert.h>
+ Include dependency graph for bcp.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Macros

#define VARCHAR_BIND(x)
 
#define INT_BIND(x)    bcp_bind( dbproc, (unsigned char *) &x, prefixlen, -1, NULL, termlen, SYBINT4, col++ )
 
#define NULL_BIND(x, type)    bcp_bind( dbproc, (unsigned char *) &x, prefixlen, 0, NULL, termlen, type, col++ )
 

Functions

static int init (DBPROCESS *dbproc, const char *name)
 
static void test_bind (DBPROCESS *dbproc)
 
int main (int argc, char **argv)
 

Variables

static char cmd [512]
 
static int not_null_bit = 1
 
static char not_null_char [] = "a char"
 
static char not_null_varchar [] = "a varchar"
 
static char not_null_datetime [] = "Dec 17 2003 3:44PM"
 
static char not_null_smalldatetime [] = "Dec 17 2003 3:44PM"
 
static char not_null_money [] = "12.34"
 
static char not_null_smallmoney [] = "12.34"
 
static char not_null_float [] = "12.34"
 
static char not_null_real [] = "12.34"
 
static char not_null_decimal [] = "12.34"
 
static char not_null_numeric [] = "12.34"
 
static int not_null_int = 1234
 
static int not_null_smallint = 1234
 
static int not_null_tinyint = 123
 

Macro Definition Documentation

◆ INT_BIND

#define INT_BIND (   x)     bcp_bind( dbproc, (unsigned char *) &x, prefixlen, -1, NULL, termlen, SYBINT4, col++ )

Definition at line 78 of file bcp.c.

◆ NULL_BIND

#define NULL_BIND (   x,
  type 
)     bcp_bind( dbproc, (unsigned char *) &x, prefixlen, 0, NULL, termlen, type, col++ )

Definition at line 81 of file bcp.c.

◆ VARCHAR_BIND

#define VARCHAR_BIND (   x)
Value:
bcp_bind( dbproc, (unsigned char *) &x, prefixlen, (DBINT) strlen(x), \
NULL, termlen, SYBVARCHAR, col++ )
#define NULL
Definition: ncbistd.hpp:225
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.
Definition: bcp.c:2032
#define SYBVARCHAR
Definition: sybdb.h:162
Int4 DBINT
Definition: sybdb.h:255
DBPROCESS * dbproc
Definition: t0013.c:18

Definition at line 74 of file bcp.c.

Function Documentation

◆ init()

static int init ( DBPROCESS dbproc,
const char *  name 
)
static

Definition at line 40 of file bcp.c.

References DATABASE, dbnextrow(), dbprhead(), dbproc, dbprrow(), dbresults(), dbsqlexec(), FAIL, NO_MORE_RESULTS, REG_ROW, SERVER, sql_cmd(), and SUCCEED.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

◆ test_bind()

static void test_bind ( DBPROCESS dbproc)
static

Variable Documentation

◆ cmd

char cmd[512]
static

Definition at line 16 of file bcp.c.

Referenced by main().

◆ not_null_bit

int not_null_bit = 1
static

Definition at line 23 of file bcp.c.

Referenced by test_bind().

◆ not_null_char

char not_null_char[] = "a char"
static

Definition at line 24 of file bcp.c.

Referenced by test_bind().

◆ not_null_datetime

char not_null_datetime[] = "Dec 17 2003 3:44PM"
static

Definition at line 26 of file bcp.c.

Referenced by test_bind().

◆ not_null_decimal

char not_null_decimal[] = "12.34"
static

Definition at line 32 of file bcp.c.

Referenced by test_bind().

◆ not_null_float

char not_null_float[] = "12.34"
static

Definition at line 30 of file bcp.c.

Referenced by test_bind().

◆ not_null_int

int not_null_int = 1234
static

Definition at line 34 of file bcp.c.

Referenced by test_bind().

◆ not_null_money

char not_null_money[] = "12.34"
static

Definition at line 28 of file bcp.c.

Referenced by test_bind().

◆ not_null_numeric

char not_null_numeric[] = "12.34"
static

Definition at line 33 of file bcp.c.

Referenced by test_bind().

◆ not_null_real

char not_null_real[] = "12.34"
static

Definition at line 31 of file bcp.c.

Referenced by test_bind().

◆ not_null_smalldatetime

char not_null_smalldatetime[] = "Dec 17 2003 3:44PM"
static

Definition at line 27 of file bcp.c.

Referenced by test_bind().

◆ not_null_smallint

int not_null_smallint = 1234
static

Definition at line 35 of file bcp.c.

Referenced by test_bind().

◆ not_null_smallmoney

char not_null_smallmoney[] = "12.34"
static

Definition at line 29 of file bcp.c.

Referenced by test_bind().

◆ not_null_tinyint

int not_null_tinyint = 123
static

Definition at line 36 of file bcp.c.

Referenced by test_bind().

◆ not_null_varchar

char not_null_varchar[] = "a varchar"
static

Definition at line 25 of file bcp.c.

Referenced by test_bind().

Modified on Tue Apr 09 08:00:15 2024 by modify_doxy.py rev. 669887
Modified on Wed Apr 10 07:35:33 2024 by modify_doxy.py rev. 669887
Modified on Thu Apr 11 15:20:47 2024 by modify_doxy.py rev. 669887
Modified on Fri Apr 12 17:23:04 2024 by modify_doxy.py rev. 669887
Modified on Sat Apr 13 11:50:18 2024 by modify_doxy.py rev. 669887
Modified on Sun Apr 14 05:29:20 2024 by modify_doxy.py rev. 669887