00001 // Class CSqlOdbcDescList, CSqlOdbcDesc 00002 // Description: Generic descriptor manager. 00003 // Used as ARD, IRD, APD, IPD. 00004 00005 #ifndef _ODBC_DESCLIST_H_ 00006 #define _ODBC_DESCLIST_H_ 00007 00008 #define SQL_DESC_APP 0 00009 #define SQL_DESC_IMP 1 00010 00011 // Bound Column/Parameter Descriptor 00012 class CSqlOdbcDesc 00013 { 00014 public: 00015 SQLSMALLINT col_; // Which column/param number is bound. ? 00016 00017 // Metadata Info 00018 SQLCHAR schemaName_[ SQL_MAX_SCHEMA_NAME_LEN ]; // Schema Name. 00019 SQLCHAR tableName_[ SQL_MAX_TABLE_NAME_LEN ]; // Table Name. 00020 SQLCHAR colName_[ SQL_MAX_COLUMN_NAME_LEN ]; // Column Name. 00021 SQLSMALLINT paramType_; // SQL_PARAM_INPUT/OUTPUT/INPUT_OUTPUT. 00022 00023 // Data at node. 00024 SQLPOINTER dataPtr_; // Data at column. 00025 SQLUINTEGER length_; // No. of bytes in data. 00026 SQLSMALLINT precision_; 00027 SQLSMALLINT scale_; 00028 SQLPOINTER indPtr_; // Indicator variable supplied in SQLBindParameter() 00029 SQLSMALLINT nullable_; // Indicator variable supplied in SQLBindParameter() 00030 00031 // DataType info. 00032 SQLSMALLINT cType_; // C datatype identifier. 00033 SQLSMALLINT csqlType_; // Equivalent CSQL Type. 00034 SQLSMALLINT sqlType_; 00035 00036 // METHODS 00037 CSqlOdbcDesc( void ); 00038 }; 00039 00040 class CSqlOdbcDescList : public std::vector<CSqlOdbcDesc*> 00041 { 00042 public: 00043 int type_; 00044 public: 00045 CSqlOdbcDescList ( int descType); 00046 SQLRETURN delDesc( CSqlOdbcDesc *node ); 00047 void freeAllDesc( void ); 00048 SQLRETURN getDescWithColNum( int colNum, CSqlOdbcDesc **out ); 00049 }; 00050 00051 #endif // _ODBC_DESCLIST_H_