88 |
|
FStatement: TFB30Statement; |
89 |
|
FFirebird30ClientAPI: TFB30ClientAPI; |
90 |
|
FBlob: IBlob; {Cache references} |
91 |
– |
FArray: IArray; |
91 |
|
FNullIndicator: short; |
92 |
|
FOwnsSQLData: boolean; |
93 |
|
FBlobMetaData: IBlobMetaData; |
140 |
|
procedure ColumnSQLDataInit; |
141 |
|
procedure RowChange; override; |
142 |
|
procedure FreeSQLData; |
143 |
< |
function GetAsArray(Array_ID: TISC_QUAD): IArray; override; |
143 |
> |
function GetAsArray: IArray; override; |
144 |
|
function GetAsBlob(Blob_ID: TISC_QUAD; BPB: IBPB): IBlob; override; |
145 |
|
function GetArrayMetaData: IArrayMetaData; override; |
146 |
|
function GetBlobMetaData: IBlobMetaData; override; |
289 |
|
procedure CheckHandle; override; |
290 |
|
procedure CheckBatchModeAvailable; |
291 |
|
procedure GetDSQLInfo(info_request: byte; buffer: ISQLInfoResults); override; |
292 |
+ |
function GetStatementIntf: IStatement; override; |
293 |
|
procedure InternalPrepare(CursorName: AnsiString=''); override; |
294 |
|
function InternalExecute(aTransaction: ITransaction): IResults; override; |
295 |
|
function InternalOpenCursor(aTransaction: ITransaction; Scrollable: boolean |
314 |
|
function GetMetaData: IMetaData; override; |
315 |
|
function GetPlan: AnsiString; |
316 |
|
function IsPrepared: boolean; |
317 |
+ |
function GetFlags: TStatementFlags; override; |
318 |
|
function CreateBlob(column: TColumnMetaData): IBlob; override; |
319 |
|
function CreateArray(column: TColumnMetaData): IArray; override; |
320 |
|
procedure SetRetainInterfaces(aValue: boolean); override; |
750 |
|
begin |
751 |
|
inherited; |
752 |
|
FBlob := nil; |
752 |
– |
FArray := nil; |
753 |
|
end; |
754 |
|
|
755 |
|
procedure TIBXSQLVAR.FreeSQLData; |
760 |
|
FOwnsSQLData := true; |
761 |
|
end; |
762 |
|
|
763 |
< |
function TIBXSQLVAR.GetAsArray(Array_ID: TISC_QUAD): IArray; |
763 |
> |
function TIBXSQLVAR.GetAsArray: IArray; |
764 |
|
begin |
765 |
|
if SQLType <> SQL_ARRAY then |
766 |
|
IBError(ibxeInvalidDataConversion,[nil]); |
769 |
|
Result := nil |
770 |
|
else |
771 |
|
begin |
772 |
< |
if FArray = nil then |
773 |
< |
FArray := TFB30Array.Create(FStatement.GetAttachment as TFB30Attachment, |
772 |
> |
if FArrayIntf = nil then |
773 |
> |
FArrayIntf := TFB30Array.Create(FStatement.GetAttachment as TFB30Attachment, |
774 |
|
TIBXSQLDA(Parent).GetTransaction, |
775 |
< |
GetArrayMetaData,Array_ID); |
776 |
< |
Result := FArray; |
775 |
> |
GetArrayMetaData,PISC_QUAD(SQLData)^); |
776 |
> |
Result := FArrayIntf; |
777 |
|
end; |
778 |
|
end; |
779 |
|
|
1142 |
|
else |
1143 |
|
FSQLNullIndicator := nil; |
1144 |
|
FBlob := nil; |
1145 |
< |
FArray := nil; |
1145 |
> |
FArrayIntf := nil; |
1146 |
|
end; |
1147 |
|
end; |
1148 |
|
SetUniqueRelationName; |
1324 |
|
end; |
1325 |
|
end; |
1326 |
|
|
1327 |
+ |
function TFB30Statement.GetStatementIntf: IStatement; |
1328 |
+ |
begin |
1329 |
+ |
Result := self; |
1330 |
+ |
end; |
1331 |
+ |
|
1332 |
|
procedure TFB30Statement.InternalPrepare(CursorName: AnsiString); |
1333 |
|
var GUID : TGUID; |
1334 |
|
begin |
1447 |
|
end; |
1448 |
|
end; |
1449 |
|
|
1450 |
+ |
var Cursor: IResultSet; |
1451 |
|
|
1452 |
|
begin |
1453 |
|
Result := nil; |
1473 |
|
begin |
1474 |
|
case FSQLStatementType of |
1475 |
|
SQLSelect: |
1476 |
< |
IBError(ibxeIsAExecuteProcedure,[]); |
1476 |
> |
{e.g. Update...returning with a single row in Firebird 5 and later} |
1477 |
> |
begin |
1478 |
> |
Cursor := InternalOpenCursor(aTransaction,false); |
1479 |
> |
if not Cursor.IsEof then |
1480 |
> |
Cursor.FetchNext; |
1481 |
> |
Result := Cursor; {note only first row} |
1482 |
> |
FSingleResults := true; |
1483 |
> |
end; |
1484 |
|
|
1485 |
|
SQLExecProcedure: |
1486 |
|
begin |
1509 |
|
var flags: cardinal; |
1510 |
|
begin |
1511 |
|
flags := 0; |
1512 |
< |
if FSQLStatementType <> SQLSelect then |
1512 |
> |
if (FSQLStatementType <> SQLSelect) and not (stHasCursor in getFlags) then |
1513 |
|
IBError(ibxeIsASelectStatement,[]); |
1514 |
|
|
1515 |
|
FBatchCompletion := nil; |
1914 |
|
Result := FStatementIntf <> nil; |
1915 |
|
end; |
1916 |
|
|
1917 |
+ |
function TFB30Statement.GetFlags: TStatementFlags; |
1918 |
+ |
var flags: cardinal; |
1919 |
+ |
begin |
1920 |
+ |
CheckHandle; |
1921 |
+ |
Result := []; |
1922 |
+ |
with FFirebird30ClientAPI do |
1923 |
+ |
begin |
1924 |
+ |
flags := FStatementIntf.getFlags(StatusIntf); |
1925 |
+ |
Check4DataBaseError; |
1926 |
+ |
end; |
1927 |
+ |
if flags and Firebird.IStatement.FLAG_HAS_CURSOR <> 0 then |
1928 |
+ |
Result := Result + [stHasCursor]; |
1929 |
+ |
if flags and Firebird.IStatement.FLAG_REPEAT_EXECUTE <> 0 then |
1930 |
+ |
Result := Result + [stRepeatExecute]; |
1931 |
+ |
if flags and Firebird.IStatement.CURSOR_TYPE_SCROLLABLE <> 0 then |
1932 |
+ |
Result := Result + [stScrollable]; |
1933 |
+ |
end; |
1934 |
+ |
|
1935 |
|
end. |
1936 |
|
|