#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <coptypes.h> /* Teradata include files */
#include <coperr.h>
#include <dbcarea.h>
#include <parcel.h>
#include <dbchqep.h>
typedef
signed
char
ByteInt;
#define BIGINT_NN 600
#define BIGINT_N 601
#define BLOB 400
#define BLOB_DEFERRED 404
#define BLOB_LOCATOR 408
#define BYTEINT_NN 756
#define BYTEINT_N 757
#define BYTE_NN 692
#define BYTE_N 693
#define CHAR_NN 452
#define CHAR_N 453
#define CLOB 416
#define CLOB_DEFERRED 420
#define CLOB_LOCATOR 424
#define DATE_NN 752
#define DATE_N 753
#define DECIMAL_NN 484
#define DECIMAL_N 485
#define FLOAT_NN 480
#define FLOAT_N 481
#define GRAPHIC_NN 468
#define GRAPHIC_N 469
#define INTEGER_NN 496
#define INTEGER_N 497
#define LONG_VARBYTE_NN 696
#define LONG_VARBYTE_N 697
#define LONG_VARCHAR_NN 456
#define LONG_VARCHAR_N 457
#define LONG_VARGRAPHIC_NN 472
#define LONG_VARGRAPHIC_N 473
#define NUMBER_NN 604
#define NUMBER_N 605
#define SMALLINT_NN 500
#define SMALLINT_N 501
#define VARBYTE_NN 688
#define VARBYTE_N 689
#define VARCHAR_NN 448
#define VARCHAR_N 449
#define VARGRAPHIC_NN 464
#define VARGRAPHIC_N 465
#define MAX_FIELDS 520
#define MAX_RDA_LEN 65400
struct
datadescr {
int
nfields;
struct
{
short
sqltype;
unsigned
short
datalen;
short
dlb;
short
decscale;
char
colident[32];
} sqlvar[MAX_FIELDS];
};
struct
ModCliDataInfoType
{
PclWord FieldCount;
struct
ModCliDInfoType {
PclWord SQLType;
PclWord SQLLen;
} InfoVar[MAX_FIELDS];
};
struct
sSession {
char
ccs[32];
struct
DBCAREA dbc;
};
struct
sRequest {
Int32 req_num;
struct
DBCAREA * dbcp;
struct
datadescr ddesc;
};
typedef
struct
sSession Session, *pSession;
typedef
struct
sRequest Request, *pRequest;
struct
irq_ext {
struct
D8CAIRX irqx_header;
struct
D8XIELEM irqx_DataInfo_elem;
struct
D8XIEP irqx_DataInfo_body;
struct
D8XIELEM irqx_IndicData_elem;
struct
D8XIEP irqx_IndicData_body;
};
struct
seg_ext {
struct
D8CAIRX seg_header;
struct
D8XIELEM seg_SPOptions_elem;
struct
D8XIEP seg_SPOptions_body;
};
int
check_cli_error (
const
char
*,
struct
DBCAREA * );
void
_simplify_prepinfo (
struct
datadescr *,
char
* );
void
_insert_dp (
char
*,
char
*,
int
);
double
_dec_to_double ( Byte *,
int
,
int
);
void
_dec_to_string (
char
*, Byte *,
int
);
double
_num_to_double ( Byte * );
void
_num_to_string (
char
*, Byte * );
void
set_options (
struct
DBCAREA * );
int
_fetch_parcel (
const
char
*,
struct
DBCAREA *, pRequest );
int
_fetch_all_parcels (
const
char
*,
struct
DBCAREA *, pRequest );
int
Zconnect ( pSession,
char
*,
char
*,
char
*,
char
* );
int
Zdisconnect ( pSession );
int
Zexecute ( pSession,
char
* );
int
Zopen ( pRequest,
char
* );
int
Zopenseg ( pRequest,
char
*,
char
* );
int
Zexecutep ( pSession,
char
* );
int
Zexecutep_args ( pSession,
char
*,
struct
ModCliDataInfoType *,
Byte *,
int
);
int
Zopenp ( pRequest,
char
* );
int
Zopenp_args ( pRequest,
char
*,
struct
ModCliDataInfoType *,
Byte *,
int
);
char
* Zfetch ( pRequest );
int
Zclose ( pRequest );
int
Zabort ( pSession );
int
Zserver_info ( DBCHQEP * );