home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep (Enterprise)
/
OpenStepENTCD.toast
/
OEMINSYS
/
INFORMAD.Z
/
InformixColumn.h
< prev
next >
Wrap
Text File
|
1996-09-09
|
3KB
|
98 lines
// InformixColumn.h
// Copyright (c) 1994, NeXT Software, Inc. All rights reserved.
//
#import <EOAccess/EOAccess.h>
#import "InformixSQLExpression.h"
// This class is used internally by the Informix adaptor to maintain the state
// of the various column buffers which are needed to fetch data.
// These are the codes for the external (in the client) Informix data types.
// InformixClientTypes specify how OCI should convert the data from the rdbms
// into a form that can be consumed by the adaptor, or to describe the format
// of of data passed into OCI by the adaptor. Not all of these are used by
// the current implementation, but are included here for completeness.
typedef enum
{
EsqlCHAR = 100,
EsqlFIXCHAR = 108,
EsqlSTRING = 109,
EsqlSMINT = 101,
EsqlINT = 102,
EsqlLONG = 103,
EsqlFLOAT = 105,
EsqlSMFLOAT = 104,
EsqlDECIMAL = 107,
EsqlSERIAL = 103,
EsqlDATE = 110,
EsqlMONEY = 111,
EsqlDTIME = 112,
EsqlLOCATOR = 113,
EsqlVCHAR = 114,
EsqlINTERVAL = 115
} InformixClientType;
@class InformixChannel;
@interface InformixColumn:NSObject
{
NSString *_attributeName;
EOAttribute *_attribute;
NSStringEncoding _encoding;
EOAdaptorValueType _adaptorValueType;
short *_indicator;
char *_columnBuffer;
InformixClientType _clientType;
int _columnLength;
}
+ (NSString *)nameForInformixServerType:(InformixServerType)type;
// For a given informix data type, return the name of the type
+ formatAttribute:(EOAttribute *)attribute;
+ (EOAttribute *)attributeWithName:(NSString *)name
columnName:(NSString *)columnName externalType:(NSString *)dbType
externalLength:(int)dbLength precision:(int)precision scale:(int)scale
nullable:(BOOL)nullable;;
// Builds an EOAttribute based on the standard set of information
// available in Informix 5.00 about database columns. This is called from
// attributeAtPosition:cursor: and by the describe routines.
+ (EOAttribute *)attributeAtPosition:(int)position
cursor:(struct informix_cursor *)cursor;
// Build an attribute for the item at "position" in the select list.
// Position indices start at 0.
- initWithAttribute:(EOAttribute *)attribute channel:(InformixChannel *)channel;
// Each column subclass must set _clientType and _columnLength in their
// initWithAttribute: method.
- (int)columnLength;
// This is a simple accessor for the _columnLength ivar.
- (BOOL)defineWithCursor:(struct informix_cursor *)cursor
selectPosition:(unsigned)index
rowCapacity:(unsigned)capacity;
// Does the infcol () to set up the buffers for fetching data and getting
// the various return codes. The instance variables _clientType and
// _columnLength must be set up by the subclasses before getting here.
// The following methods are the ones which InformixColumn subclasses need to
// implement to work with the rest of the adaptor.
- (BOOL)canUseArrayFetching;
// By default this returns YES. Subclasses should return NO if they cannot
// use Informix's array fetching API.
- fetchFromIndex:(unsigned)index zone:(NSZone *)zone;
// This is the method which gets called to actually fetch data into a row.
@end