beautypg.com

HP Integrity NonStop H-Series User Manual

Page 55

background image

//
// Copyright 2007
//
// HP CONFIDENTIAL: NEED TO KNOW ONLY
//
// Copyright Hewlett-Packard Development Company, L.P.
// Protected as an unpublished work.
//
// The computer program listings, specifications and
// documentation herein are the property of Hewlett-Packard
// Development Company, L.P., or a third party supplier and
// shall not be reproduced, copied, disclosed, or used in whole
// or in part for any reason without the prior express written
// permission of Hewlett-Packard
// Development Company, L.P.
//
// @@@ END COPYRIGHT @@@
***************************************************************/
/***************************************************************
@@@@ ODBC TEST APPLICATION @@@
================================================================
This application utilizes ::
- Multiple connections
- Gives information about DBMS NAME
- ODBC API's
- Uses insertion through parameter marker,
- Setting the transaction isolation level as serializable and
fetches the data.
****************************************************************
******/

#include
#include
#include
#include

#define UnSignCharCast unsigned char *
#define TRUE 1
typedef struct
{
SDWORD pfNativeError[1];
SWORD pcbErrorMsg[1];
SWORD cbErrorMsgMax;
UCHAR *szErrorMsg;
UCHAR *szSqlState;
} ERR_INFO;
RETCODE odbc_Error(SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt);
RETCODE odbc_Error(
SQLHENV hEnv,
SQLHDBC hDbc,
SQLHSTMT hStmt
)
{
char *szBuf;
int pt_ch ='.' ;
int brac_ch =']' ;
ERR_INFO *Err;
RETCODE st = 0;
Err = (ERR_INFO *)malloc (sizeof(ERR_INFO));
Err->szErrorMsg = (UnSignCharCast )malloc(200);
Err->szSqlState = (UnSignCharCast )malloc(50);
szBuf = (char *)malloc(600);
memset (Err->szErrorMsg,'\0',200);
memset (Err->szSqlState,'\0',50);

Testing the sample

55

This manual is related to the following products: