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; |
1443 |
|
end; |
1444 |
|
end; |
1445 |
|
|
1446 |
+ |
var Cursor: IResultSet; |
1447 |
|
|
1448 |
|
begin |
1449 |
|
Result := nil; |
1469 |
|
begin |
1470 |
|
case FSQLStatementType of |
1471 |
|
SQLSelect: |
1472 |
< |
IBError(ibxeIsAExecuteProcedure,[]); |
1472 |
> |
{e.g. Update...returning with a single row in Firebird 5 and later} |
1473 |
> |
begin |
1474 |
> |
Cursor := InternalOpenCursor(aTransaction,false); |
1475 |
> |
if not Cursor.IsEof then |
1476 |
> |
Cursor.FetchNext; |
1477 |
> |
Result := Cursor; {note only first row} |
1478 |
> |
FSingleResults := true; |
1479 |
> |
end; |
1480 |
|
|
1481 |
|
SQLExecProcedure: |
1482 |
|
begin |
1505 |
|
var flags: cardinal; |
1506 |
|
begin |
1507 |
|
flags := 0; |
1508 |
< |
if FSQLStatementType <> SQLSelect then |
1508 |
> |
if (FSQLStatementType <> SQLSelect) and not (stHasCursor in getFlags) then |
1509 |
|
IBError(ibxeIsASelectStatement,[]); |
1510 |
|
|
1511 |
|
FBatchCompletion := nil; |
1910 |
|
Result := FStatementIntf <> nil; |
1911 |
|
end; |
1912 |
|
|
1913 |
+ |
function TFB30Statement.GetFlags: TStatementFlags; |
1914 |
+ |
var flags: cardinal; |
1915 |
+ |
begin |
1916 |
+ |
CheckHandle; |
1917 |
+ |
Result := []; |
1918 |
+ |
with FFirebird30ClientAPI do |
1919 |
+ |
begin |
1920 |
+ |
flags := FStatementIntf.getFlags(StatusIntf); |
1921 |
+ |
Check4DataBaseError; |
1922 |
+ |
end; |
1923 |
+ |
if flags and Firebird.IStatement.FLAG_HAS_CURSOR <> 0 then |
1924 |
+ |
Result := Result + [stHasCursor]; |
1925 |
+ |
if flags and Firebird.IStatement.FLAG_REPEAT_EXECUTE <> 0 then |
1926 |
+ |
Result := Result + [stRepeatExecute]; |
1927 |
+ |
if flags and Firebird.IStatement.CURSOR_TYPE_SCROLLABLE <> 0 then |
1928 |
+ |
Result := Result + [stScrollable]; |
1929 |
+ |
end; |
1930 |
+ |
|
1931 |
|
end. |
1932 |
|
|