/*
**  OracleAdaptorChannel.h
**
**  Copyright (c) 2007  Inverse groupe conseil inc. and Ludovic Marcotte
**
**  Author: Ludovic Marcotte <ludovic@inverse.ca>
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifndef _OracleAdaptorChannel_H
#define _OracleAdaptorChannel_H

#include <oci.h>

#import <GDLAccess/EOAdaptorChannel.h>

//#import "../GDLContentStore/EOAdaptorChannel+GCS.h"

@class NSMutableArray;

typedef struct
{
  OCIDefine *def;   // The define information handle of the column
  dvoid *value;     // The value of the column (the buffer size is max_width bytes)
  ub2 type;         // The type of the column
  ub2 width;        // The current width of the value that has been read
  ub2 max_width;    // The maximum width of the column
} column_info;

@interface OracleAdaptorChannel : EOAdaptorChannel
{
@private
  // Oracle's related ivars
  OCIEnv* _oci_env;
  OCISvcCtx* _oci_ctx;
  OCIError* _oci_err;
  OCIStmt* _current_stm;

  // ...
  NSMutableArray *_resultSetProperties;
  NSMutableArray *_row_buffer;
}

- (OCIEnv *) environment;
- (OCISvcCtx *) serviceContext;
- (OCIError *) errorHandle;

@end

#endif
