Remote Stored Procedure
Setting up a remote stored procedure works the same way as normal stored procedures. The differences are:
- Only the parameters are important; they must be defined in the same order as they are defined in the stored procedure on the remote system.
- The reo does not define the stored procedure in the local database. This is because the stored procedure is marked as a remote procedure.
- In the developer, the remote database needs to be assigned to the .database property of the stored-proc component.
- In the stored procedure form, mark the “Remote database” option.
- Enter the parameters of the stored procedure. If multiple then define them in the same order as they are defined in the remote procedure.
- Save the newly created stored procedure, and check it in.
- Numerics with decimals need to be defined in the procedures/functions as NUMBER.
- In the logic, you can now define:
BEGIN_DEFINITIONS
VAR
SP_TRACKING_DELETE : storedproc(SP_TRACKING_DELETE)
END_DEFINITIONS
ROUTINE PROCESS_MAIN
BEGIN_ROUTINE
SP_TRACKING_DELETE.database := 'remotedbs'
SP_TRACKING_DELETE.execute()
if resok
sme(SP_TRACKING_DELETE.X)
else
sme(getlastresult)
endif
END_ROUTINE
VAR
SP_TRACKING_DELETE : storedproc(SP_TRACKING_DELETE)
END_DEFINITIONS
ROUTINE PROCESS_MAIN
BEGIN_ROUTINE
SP_TRACKING_DELETE.database := 'remotedbs'
SP_TRACKING_DELETE.execute()
if resok
sme(SP_TRACKING_DELETE.X)
else
sme(getlastresult)
endif
END_ROUTINE