25 |
|
* |
26 |
|
*) |
27 |
|
unit FB25Array; |
28 |
+ |
{$IFDEF MSWINDOWS} |
29 |
+ |
{$DEFINE WINDOWS} |
30 |
+ |
{$ENDIF} |
31 |
|
|
32 |
|
{$IFDEF FPC} |
33 |
< |
{$mode objfpc}{$H+} |
33 |
> |
{$mode delphi} |
34 |
|
{$codepage UTF8} |
35 |
|
{$interfaces COM} |
36 |
|
{$ENDIF} |
50 |
|
FCodePage: TSystemCodePage; |
51 |
|
protected |
52 |
|
procedure LoadMetaData(aAttachment: IAttachment; aTransaction: ITransaction; |
53 |
< |
relationName, columnName: string); override; |
53 |
> |
relationName, columnName: AnsiString); override; |
54 |
|
public |
55 |
|
function GetCharSetID: cardinal; override; |
56 |
|
function GetCodePage: TSystemCodePage; override; |
83 |
|
{ TFB25ArrayMetaData } |
84 |
|
|
85 |
|
procedure TFB25ArrayMetaData.LoadMetaData(aAttachment: IAttachment; |
86 |
< |
aTransaction: ITransaction; relationName, columnName: string); |
86 |
> |
aTransaction: ITransaction; relationName, columnName: AnsiString); |
87 |
|
var |
88 |
|
DBHandle: TISC_DB_HANDLE; |
89 |
|
TRHandle: TISC_TR_HANDLE; |
90 |
|
stmt: IStatement; |
91 |
|
CharWidth: integer; |
92 |
+ |
RelName: AnsiString; |
93 |
+ |
ColName: AnsiString; |
94 |
|
begin |
95 |
|
DBHandle := (aAttachment as TFB25Attachment).Handle; |
96 |
|
TRHandle := (aTransaction as TFB25Transaction).Handle; |
97 |
+ |
RelName := AnsiUpperCase(relationName); |
98 |
+ |
ColName := AnsiUpperCase(columnName); |
99 |
|
with Firebird25ClientAPI do |
100 |
|
if isc_array_lookup_bounds(StatusVector,@(DBHandle),@(TRHandle), |
101 |
< |
PChar(AnsiUpperCase(relationName)),PChar(AnsiUpperCase(columnName)),@FArrayDesc) > 0 then |
101 |
> |
PAnsiChar(RelName),PAnsiChar(ColName),@FArrayDesc) > 0 then |
102 |
|
IBDatabaseError; |
103 |
|
|
104 |
|
if (GetSQLType = SQL_TEXT) or (GetSQLType = SQL_VARYING) then |
132 |
|
with aAttachment as TFBAttachment do |
133 |
|
begin |
134 |
|
if HasDefaultCharSet and FirebirdClientAPI.CharSetWidth(CharSetID,CharWidth) then |
135 |
< |
FArrayDesc.array_desc_length *= CharWidth; |
135 |
> |
FArrayDesc.array_desc_length := FArrayDesc.array_desc_length * CharWidth; |
136 |
|
end; |
137 |
|
end; |
138 |
|
|