1 /***************************************************************************
3 * Copyright (C) Lakshya Solutions Ltd. All rights reserved. *
5 ***************************************************************************/
13 //used by FieldNameList
17 char fldName
[IDENTIFIER_LENGTH
];
38 isAutoIncrement_
=false;
39 isNullExplicit_
= false;
42 char fldName_
[IDENTIFIER_LENGTH
];
46 //currently default value is supported for string and binary
47 //less than length 32 bytes
48 char defaultValueBuf_
[DEFAULT_VALUE_BUF_LENGTH
];
50 //used only in case of binding fields
57 bool isAutoIncrement_
;
58 bool isNullExplicit_
; // if null is specified on default value field.
59 long long autoVal_
;//[DEFAULT_VALUE_BUF_LENGTH];
60 //TODO::width and scale
75 FieldIterator(FieldNode
*ptr
) { iter
= ptr
; }
78 if (iter
== NULL
) return false; else return true;
80 FieldDef
* nextElement()
82 if (iter
== NULL
) { return NULL
;}
83 FieldNode
*node
= iter
;
85 return &(node
->fldDef
);
91 //Internal class used to implement the field list information
97 FieldList(){ head
= NULL
;}
99 //TODO::pass by reference instead of value
100 DbRetVal
append(FieldDef fDef
);
102 DbRetVal
remove(const char* fldName
);
104 DbRetVal
removeAll();
106 DbRetVal
updateBindVal(const char *fldName
, void *val
, bool isNllEx
=false);
107 void * getBindField(const char *fldName
);
108 int getFieldOffset(const char *fldName
);
109 int getFieldOffset(int fldpos
);
111 //Returns position of field in the list:count starting from 1
112 int getFieldPosition(const char *fldName
);
114 DataType
getFieldType(const char *fldName
);
116 size_t getFieldLength(const char *fldName
);
118 DbRetVal
getFieldInfo(const char *fldName
, FieldInfo
*&info
);
119 void fillFieldInfo(int fldpos
, void *info
);
123 FieldIterator
getIterator()
125 FieldIterator
iter(head
);
130 //The below struct should be same as Parser.h:FieldValue
131 //For performance reason and it is
132 //done such that storage does not have dependency on SQL
133 struct FieldInfoValue
135 char fldName
[IDENTIFIER_LENGTH
];
138 int paramNo
; // 0 ->not a param. It stores the param position
140 int aType
; //assumes enum is always int
149 bool isAutoIncrement
;