/* * $Header: cdemolb.h 03-jan-97.15:16:56 echen Exp $ */ /* Copyright (c) Oracle Corporation 1996, 1997. All Rights Reserved. */ /* NOTE: See 'header_template.doc' in the 'doc' dve under the 'forms' directory for the header file template that includes instructions. */ /* NAME cdemolb.h - Header file for cdemolb.c DESCRIPTION see cdemolb.c RELATED DOCUMENTS INSPECTION STATUS Inspection date: Inspection status: Estimated increasing cost defects per page: Rule sets: ACCEPTANCE REVIEW STATUS Review date: Review status: Reviewers: PUBLIC FUNCTION(S) PRIVATE FUNCTION(S) EXAMPLES NOTES see cdemolb.c MODIFIED (MM/DD/YY) azhao 01/31/97 - don't include orastd.h azhao 01/30/97 - fix lint error echen 01/03/97 - OCI beautification pshah 10/11/96 - aroy 07/22/96 - Header file for cdemolb.c aroy 07/22/96 - Creation */ #ifndef cdemolb # define cdemolb #ifndef OCI_ORACLE #include #endif /*--------------------------------------------------------------------------- TYPES AND CONSTANTS ---------------------------------------------------------------------------*/ #define LFCOUNT 1 #define STMTLEN 100 #define LONGTEXTLENGTH 1024 #define BUFSIZE 1024 #define EX_FAILURE 1 #define EX_SUCCESS 0 #define CDEMOLB_TEXT_FILE "cdemolb.dat" static CONST text insstmt[LFCOUNT][STMTLEN] = { "INSERT INTO CLBTAB VALUES ( 'Jack', EMPTY_CLOB())" }; static CONST text selstmt[LFCOUNT][STMTLEN] = { "SELECT essay FROM CLBTAB WHERE name = 'Jack' for update" }; typedef struct { /* statement bind/define handles */ OCIStmt *stmhp; OCIBind *bndhp[2]; OCIDefine *dfnhp[2]; } stmtdef; typedef struct { /* GLOBAL STRUCTURE */ OCIEnv *envhp; /* Environment handle */ OCISvcCtx *svchp; /* Service handle */ OCIServer *srvhp; /* Server handles */ OCIError *errhp; /* Error handle */ OCISession *authp; /* Authentication handle */ stmtdef *s1; /*Statement handle 1 - for inserting*/ stmtdef *s2; /* Handle for -select update */ } ldemodef; /* define macros to be used in tests */ #define COMMENT(x) (void) fprintf(stdout,"\nCOMMENT: %s\n", x) /*--------------------------------------------------------------------------- FUNCTIONS ---------------------------------------------------------------------------*/ static void alloc_lob_desc(/*_ ldemodef *ctx, OCILobLocator **lobsrc _*/); static ldemodef *alloc_handles(/*_ void _*/); static void cleanup(/*_ ldemodef *ctx _*/); static void errrpt(/*_ ldemodef *ctx, const text *op _*/); static void authenticate_user(/*_ ldemodef *ctx _*/); static void alloc_stmt_handles(/*_ ldemodef *ctx, stmtdef *sptr, sb2 nbnd, sb2 ndfn _*/); static void insert_select_loc (/*_ ldemodef *ctx, dvoid *lobsrc _*/); static void Write_to_loc(/*_ ldemodef *ctx, OCILobLocator *lobp _*/); static void Read_from_loc(/*_ ldemodef *ctx, OCILobLocator *lobp _*/); static void deauthenticate(/*_ ldemodef *ctx _*/); #endif /* cdemolb */