Borland®
Community
[an error occurred while processing this directive]  ENTERA DEVELOPER SUPPORT

Frequently Asked Questions

Invoking non-published RPCs using TEnteraProvider

Question:

I'm using Delphi Enterprise to connect to an Entera data server.
The RPC's  ConflictRPC, DeleteRPC, InsertRPC, SelectRPC and 
UpdateRPC can be invoked by using 'Invoke.<RPC Function>' (ie
Invoke.SelectRPC()), but how do I invoke a RPC that is not 
published - for example sql_set_max_rows_<ServerName>?

Answer:

Currently there is no way to invoke such RPCs using 
TEnteraProvider's published properties/methods.  However, there
is a workaround that involves a bit of coding.  The folowing
example calls sql_set_max_rows_test where test = ServerName and 
EnteraConnection1 = name of my TEnteraConnection object.

with TRPCFunction.Create(Self) do
try
	Name := 'sql_set_max_rows_test'; //test is ServerName
	with Params.Add do
	begin
		DataType := dtInteger;
		ParamName := 'maxrows';  
		ParamType := ptInput;
		Value := 10; //number of rows to retrive at one time
	end;
	Invoke(EnteraConnection1,True);
finally
	Free;
end;