39 |
|
|
40 |
|
uses |
41 |
|
Classes, SysUtils, Firebird, IB, FBArray, IBHeader, FB30Attachment, FBClientAPI, |
42 |
< |
FB30Transaction, FBParamBlock; |
42 |
> |
FB30Transaction, FBParamBlock, FB30ClientAPI; |
43 |
|
|
44 |
|
type |
45 |
|
|
74 |
|
private |
75 |
|
FAttachmentIntf: Firebird.IAttachment; |
76 |
|
FTransactionIntf: Firebird.ITransaction; |
77 |
+ |
FFirebird30ClientAPI: TFB30ClientAPI; |
78 |
|
FSDL: ISDL; |
79 |
|
protected |
80 |
|
procedure AllocateBuffer; override; |
91 |
|
|
92 |
|
TSDLBlock = class (TCustomParamBlock<TSDLItem,ISDLItem>, ISDL) |
93 |
|
public |
94 |
< |
constructor Create; |
94 |
> |
constructor Create(api: TFBClientAPI); |
95 |
|
end; |
96 |
|
|
97 |
|
implementation |
98 |
|
|
99 |
< |
uses FBAttachment, FB30ClientAPI, FB30Statement; |
99 |
> |
uses FBAttachment, FB30Statement; |
100 |
|
|
101 |
|
const |
102 |
|
sGetArrayMetaData = 'Select F.RDB$FIELD_LENGTH, F.RDB$FIELD_SCALE, F.RDB$FIELD_TYPE, '+ |
126 |
|
var stmt: IStatement; |
127 |
|
CharWidth: integer; |
128 |
|
begin |
129 |
+ |
CharWidth := 0; |
130 |
|
RelationName := AnsiUpperCase(RelationName); |
131 |
|
ColumnName := AnsiUpperCase(ColumnName); |
132 |
|
stmt := TFB30Statement.Create(aAttachment as TFB30Attachment,aTransaction, |
203 |
|
inherited AllocateBuffer; |
204 |
|
{Now set up the SDL} |
205 |
|
|
206 |
< |
FSDL := TSDLBlock.Create; |
206 |
> |
FSDL := TSDLBlock.Create(FFirebird30ClientAPI); |
207 |
|
with GetArrayDesc^ do |
208 |
|
{The following is based on gen_SDL from Firebird src/dsql/array.cpp} |
209 |
|
begin |
250 |
|
|
251 |
|
procedure TFB30Array.InternalGetSlice; |
252 |
|
begin |
253 |
< |
with Firebird30ClientAPI do |
253 |
> |
with FFirebird30ClientAPI do |
254 |
|
begin |
255 |
|
FAttachmentIntf.getSlice(StatusIntf,FTransactionIntf, |
256 |
|
@FArrayID, |
266 |
|
|
267 |
|
procedure TFB30Array.InternalPutSlice(Force: boolean); |
268 |
|
begin |
269 |
< |
with Firebird30ClientAPI do |
269 |
> |
with FFirebird30ClientAPI do |
270 |
|
begin |
271 |
|
FAttachmentIntf.putSlice(StatusIntf,FTransactionIntf, @FArrayID, |
272 |
|
(FSDL as TSDLBlock).getDataLength, |
286 |
|
inherited Create(aAttachment,aTransaction,aField); |
287 |
|
FAttachmentIntf := aAttachment.AttachmentIntf; |
288 |
|
FTransactionIntf := aTransaction.TransactionIntf; |
289 |
+ |
FFirebird30ClientAPI := aAttachment.Firebird30ClientAPI; |
290 |
|
end; |
291 |
|
|
292 |
|
constructor TFB30Array.Create(aAttachment: TFB30Attachment; |
295 |
|
inherited Create(aAttachment,aTransaction,aField,ArrayID); |
296 |
|
FAttachmentIntf := aAttachment.AttachmentIntf; |
297 |
|
FTransactionIntf := aTransaction.TransactionIntf; |
298 |
+ |
FFirebird30ClientAPI := aAttachment.Firebird30ClientAPI; |
299 |
|
end; |
300 |
|
|
301 |
|
{ TSDLBlock } |
302 |
|
|
303 |
< |
constructor TSDLBlock.Create; |
303 |
> |
constructor TSDLBlock.Create(api: TFBClientAPI); |
304 |
|
begin |
305 |
< |
inherited Create; |
305 |
> |
inherited Create(api); |
306 |
|
FDataLength := 1; |
307 |
|
FBuffer^ := isc_sdl_version1; |
308 |
|
end; |