procedure TZStoredProc.ExecProc;
begin
Connection.ShowSQLHourGlass;
try
if Active then
Close;
ExecSQL;
RetrieveParamValues;
finally
Connection.HideSQLHourGlass;
end;
end;
{**
Procedure the First retrieved resultset if the givens
}
procedure TZStoredProc.FirstResultSet;
begin
if Assigned(Statement) then
if (Statement as IZCallableStatement).HasMoreResultSets then
SetAnotherResultset((Statement as IZCallableStatement).GetFirstResultSet);
end;
{**
Procedure the Previous retrieved resultset if the givens
}
procedure TZStoredProc.PreviousResultSet;
begin
if Assigned(Statement) then
if (Statement as IZCallableStatement).HasMoreResultSets then
SetAnotherResultset((Statement as IZCallableStatement).GetPreviousResultSet);
end;
{**
Procedure the Next retrieved resultset if the givens
}
procedure TZStoredProc.NextResultSet;
begin
if Assigned(Statement) then
if (Statement as IZCallableStatement).HasMoreResultSets then
SetAnotherResultset((Statement as IZCallableStatement).GetNextResultSet);
end;
{**
Procedure the Last retrieved resultset if the givens
}
procedure TZStoredProc.LastResultSet;
begin
if Assigned(Statement) then
if (Statement as IZCallableStatement).HasMoreResultSets then
SetAnotherResultset((Statement as IZCallableStatement).GetLastResultSet);
end;
{**
Retrieves a ResultSet by his index.
@param Integer the index of the Resultset
@result <code>IZResultSet</code> of the Index or nil.
}
procedure TZStoredProc.SetResultSet(const Index: Integer);
begin
if Assigned(Statement) then
if ( Index < 0 ) or ( Index > (Statement as IZCallableStatement).GetResultSetCount -1 ) then
raise Exception.Create(Format(SListIndexError, [Index]))
else
SetAnotherResultset((Statement as IZCallableStatement).GetResultSetByIndex(Index));
end;
{**
Returns the Count of retrived ResultSets.
@result <code>Integer</code> Count
}
function TZStoredProc.ResultSetCount: Integer;
begin
Result := 0;
if Assigned(Statement) then
if (Statement as IZCallableStatement).HasMoreResultSets then
Result := (Statement as IZCallableStatement).GetResultSetCount;
end;
{**
First ResultSet?
@result <code>True</code> if first ResultSet
}
function TZStoredProc.BOR: Boolean;
begin
Result := True;
if Assigned(Statement) then
if (Statement as IZCallableStatement).HasMoreResultSets then
Result := (Statement as IZCallableStatement).BOR;
end;
{**
Last ResultSet?
@result <code>True</code> if Last ResultSet
}
function TZStoredProc.EOR: Boolean;
begin
Result := True;
if Assigned(Statement) then
if (Statement as IZCallableStatement).HasMoreResultSets then
Result := (Statement as IZCallableStatement).EOR;
end;