Sets the value of a remote stored procedure call return parameter.
Important This Open Data Services function or macro is only supported in Microsoft® SQL Server™ version 7.0 for backward compatibility. It has been superseded by the srv_paramsetoutput function.
For more information about Open Data Services functions or macros supported for backward compatibility, see Open Data Services (Level 3).
int srv_paramset (
SRV_PROC * srvproc,
int n ,
void * data,
int len );
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.
This function returns the following values, if the parameter is one of the new SQL Server 7.0 data types.
New data types | Return data length | |||
---|---|---|---|---|
NULL | ZERO | >=255 | <255 | |
BITN | len = 0 data = IG RET = 0 |
N/A | N/A | N/A |
BIGVARCHAR | len = 0 data = IG RET = 1 |
len = IG data = IG RET = 0 |
len = max8k data = valid RET = 0 |
len = <8k data = valid RET = 1 |
BIGCHAR | len = 0 data = IG RET = 1 |
len = IG data = IG RET = 0 |
len = max8k data = valid RET = 0 |
len = <8k data = valid RET = 1 |
BIGBINARY | len = 0 data = IG RET = 1 |
len = IG data = IG RET = 0 |
len = max8k data = valid RET = 0 |
len = <8k data = valid RET = 1 |
BIGVARBINARY | len = 0 data = IG RET = 1 |
len = IG data = IG RET = 0 |
len = max8k data = valid RET = 0 |
len = <8k data = valid RET = 1 |
NCHAR | len = 0 data = IG RET = 1 |
len = IG data = IG RET = 0 |
len = max8k data = valid RET = 0 |
len = <8k data = valid RET = 1 |
NVARCHAR | len = 0 data = IG RET = 1 |
len = IG data = IG RET = 0 |
len = max8k data = valid RET = 0 |
len = <8k data = valid RET = 1 |
NTEXT | len = IG data = IG RET = 0 |
len = IG data = IG RET = 0 |
len = IG data = IG RET = 0 |
len = IG data = IG RET = 0 |
RET = Return value of srv_paramset | ||||
IG = Value will be ignored | ||||
valid = Any valid pointer to data |
Parameters contain data 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.
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.