DBD-MaxDB

 view release on metacpan or  search on metacpan

dbdimp.h  view on Meta::CPAN

/*!
  @file           dbdimp.h
  @author         MarcoP, ThomasS
  @ingroup        dbd::MaxDB
  @brief          

\if EMIT_LICENCE

    ========== licence begin  SAP

    (c) Copyright 2001-2006 SAP AG

    All rights reserved.

    ========== licence end




\endif
*/
#ifdef _WIN32
#include <malloc.h>
#endif
/**
 * Comes with MaxDB's SQLDBC sdk.
 */
#include <SQLDBC_C.h>      
#include <SQLDBC_Types.h>  

#define NEED_DBIXS_VERSION 9

/**
 * Comes with DBI.
 */
#include <DBIXS.h>	
#include <dbd_xsh.h>	

/**
 * @brief This holds global data of the driver itself.
 */ 
struct imp_drh_st {
    dbih_drc_t com;		     /*!< MUST be first element in structure	*/
    SQLDBC_Environment *m_maxDBEnv;  /*!< MaxDB environment handle*/
};

/**
 * @brief This holds MaxDB Metadata. Maybe SQLDBC provides this sometime
 */ 
typedef struct SQLDBC_DatabaseMetaData {
  SQLDBC_UInt2 getMaxTablenameLength;   /*!< maximum length of a table name */
  SQLDBC_UInt2 getMaxCursorLength;      /*!< maximum length of a cursor name */
  SQLDBC_UInt2 getMaxColumnnameLength;  /*!< maximum length of a column name */
} SQLDBC_DatabaseMetaData;

/* 
 * @brief This holds everything to describe the database connection.
 */
struct imp_dbh_st {
  dbih_dbc_t com;		           /*!< MUST be first element in structure	*/
  SQLDBC_ConnectProperties *m_connprop;    /*!< MaxDB connect properties */
  SQLDBC_Connection        *m_connection;  /*!< MaxDB connect handle */
  SQLDBC_DatabaseMetaData  *m_dbmd;        
  SQLDBC_Statement         *m_stmt;        /*!< MaxDB statement handle use by executeUpdate*/
  SQLDBC_Bool               m_readlongcompletly; /*!< Flag that signal if blob/clob columns should be read completely*/
};

/*
 *  @brief internal structure for holding bind parameters.
 */
typedef struct dbd_maxdb_bind_param {
    SV* value;               /*!< parameter value */
    int sqltype;             /*!< parameter type provide via bind method */
    SQLDBC_HostType hostType;   /*!< column datatyp */
    SQLDBC_Length indicator; /*!< indicator value */
    ParameterMode paramMode; /*!< indicator value */
} dbd_maxdb_bind_param;

/*
 *  @brief internal structure for holding bind columns.
 */
typedef struct dbd_maxdb_bind_column {
    char* buf;                  /*!< offset pointer to internal buffer */
    SQLDBC_Length   bufLen;     /*!< maximum length of buffer within the result */
    SQLDBC_HostType hostType;   /*!< host variable data type */
    SQLDBC_SQLType  columnType; /*!< database column data type */
    SQLDBC_Length   indicator;  /*!< coulumn indicator */
    SQLDBC_Bool     chopBlanks; /*!< flag that indicates whether the column is relevant for cutoff blanks*/
} dbd_maxdb_bind_column;

/* 
 * @brief Define sth implementor data structure 
 */
struct imp_sth_st {
  dbih_stc_t com;		/* MUST be first element in structure	*/
  SQLDBC_PreparedStatement *m_prepstmt;  /*!< MaxDB prepared statement handle */
  SQLDBC_ResultSet         *m_resultset; /*!< MaxDB resultset handle */
  SQLDBC_ResultSetMetaData *m_rsmd;      /*!< MaxDB resultset metadata handle */
  SQLDBC_ParameterMetaData *m_paramMetadata; /*!< MaxDB parameter meta data handle*/
  dbd_maxdb_bind_param     *m_bindParms;     /*!< bind parameter values */
  SQLDBC_Bool               m_rowNotFound;   /*!< flag that indicates that the latests resultset is empty */
  char*                     m_fetchBuf;      /*!< internal buffer that contains the latest fetched row*/
  dbd_maxdb_bind_column    *m_cols;          /*!< bind column values */
  SQLDBC_Bool               m_hasOutValues;  /*!< flag that indicates whether this statement has out paramter(s) or not*/
      
  SQLDBC_UInt4              m_rowSetSize;    /*!< Size of the rowset, 0 means undef*/  
  SQLDBC_Bool               m_rowSetSizeChanged;  /*!< flag that indicates that the rowsetsize has been changed*/
  SQLDBC_Int2               m_fetchSize;     /*!< fetch size, 0 means undef*/ 
};

/* These defines avoid name clashes for multiple statically linked DBD's        */



( run in 1.063 second using v1.01-cache-2.11-cpan-39bf76dae61 )