ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/3.0/FB30Statement.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/3.0/FB30Statement.pas (file contents):
Revision 350 by tony, Wed Oct 20 14:58:56 2021 UTC vs.
Revision 359 by tony, Tue Dec 7 09:37:32 2021 UTC

# Line 314 | Line 314 | type
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;
# Line 1442 | Line 1443 | function TFB30Statement.InternalExecute(
1443      end;
1444    end;
1445  
1446 + var Cursor: IResultSet;
1447  
1448   begin
1449    Result := nil;
# Line 1467 | Line 1469 | begin
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
# Line 1496 | Line 1505 | function TFB30Statement.InternalOpenCurs
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;
# Line 1901 | Line 1910 | begin
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines