Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBExpress Return Value from Stored Procedure

Status
Not open for further replies.

keenanbr

Programmer
Oct 3, 2001
469
IE
Given
Code:
set ANSI_NULLS OFF
set QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[sp_DiaryShow] @mySalesDesk varchar(50)
AS
	declare @iCount int

	select @iCount = count(*) from boss_system
	where Parameter ='DiaryNotAllowed'
	and value = @mySalesDesk

	IF @iCount >= 1 /* not allowed to see diary */
		RETURN 0
	else		/* can see diary options */
	             RETURN 1

How do I check the RETURN value

I have tried

Code:
procedure TForm1.Button1Click(Sender: TObject);
Var
  retVal: integer;
 begin
  with SQLDataSet1 do
  begin
    parambyname('@mySalesDesk').asstring :='BIF Direct Apps Dub';
    RetVal := execSQL;
    ShowMessage(IntToStr(RetVal));
  end;
end;

SqldataSet1 is a TSQLDataSet with CommandType ctStoredProc.

Thanks,
 
For MSSQL stored procedures I usually see an additional parameter in Delphi @RC that holds the return value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top