Having this:
procedure Foo;
begin
end;
function Bar: TProcedure;
begin
Result := Foo;
end;
The following compiles:
var
tmp: TProcedure;
begin
tmp := Bar();
tmp();
...but the following doesn't compile in Delphi:
Bar()();
Is there a reason for this "limitation"? Does Bar()();
syntax compile in some other "flavour" of Pascal? Would Bar()();
syntax compile in some other context?
We cannot call store procedure within a function. However, we can call a function within a store procedure.
A stored procedure does not have a return value but can optionally take input, output, or input-output parameters. A stored procedure can return output through any output or input-output parameter.
Expand the database that you want, expand Programmability, and then expand Stored Procedures. Right-click the user-defined stored procedure that you want and select Execute Stored Procedure. In the Execute Procedure dialog box, specify a value for each parameter and whether it should pass a null value.
In SQL Server Management Studio (SSMS), expand Programmability > Stored Procedures, right click a stored procedure and select Execute Stored Procedure. In the execute procedure page, enter the parameter @CustID value as 10 and click OK. It returns the following T-SQL statement with a variable @return_value.
Simply call as
TProcedure(Bar());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With