Sets the value of a remote stored procedure call return parameter.
int srv_paramset (
SRV_PROC * srvproc,
int n,
void * data,
int len );
where
SUCCEED if the parameter value was successfully set; otherwise, FAIL. FAIL is returned when there is no current remote stored procedure, when there is no nth remote stored procedure parameter, when the parameter is not a return parameter, and when the len argument isn't legal.
If len is 0, returns NULL. Setting len to 0 is the only way to return NULL to the client.
Parameters contain data that is passed between clients and the Open Data Services server application with remote stored procedures. The client can specify certain parameters as return parameters. These return parameters can contain values that the Open Data Services server application passes back to the client. Using return parameters is analogous to passing parameters by reference.
You cannot set the return value for a parameter that wasn't invoked as a return parameter. You can use srv_paramstatus to determine how the parameter was invoked.
This function sets the return value for a parameter but it doesn't actually send the return value to the client. All return parameters, whether their return values have been set with srv_paramset or not, are automatically sent to the client when srv_senddone is called with the status flag SRV_DONE_FINAL set.
The srv_paramset function provides the only way to reset return parameters when the current client command is a remote stored procedure.
When a remote stored procedure call is made with parameters, the parameters can be passed either by name or by position (unnamed). If the remote stored procedure call is made with some parameters passed by name and some passed by position, an error occurs. The SRV_RPC handler is still called, but it appears as if there were no parameters, and srv_rpcparams returns 0.
This entry | For information about |
---|---|
srv_paramdata | Returning the value of a remote stored procedure parameter |
srv_paramlen | Returning the data length of a remote stored procedure parameter |
srv_parammaxlen | Returning the maximum data length of a remote stored procedure parameter |
srv_paramname | Returning the name of a remote stored procedure parameter |
srv_paramnumber | Returning the number of a remote stored procedure parameter |
srv_paramstatus | Returning the status of a remote stored procedure parameter |
srv_paramtype | Returning the datatype of a remote stored procedure parameter |