home *** CD-ROM | disk | FTP | other *** search
- .Na "dbrpcparam"
- .mc |
- .Aa
- .Fu
- Add a parameter to a remote procedure call.
- .Ih "remote procedure call"
- .Ih "stored procedure, calling"
- .Ih "call, remote procedure"
- .Sy
- .Sf "RETCODE dbrpcparam(dbproc, paramname, status, type, maxlen,"
- .sp -1v
- .Sf " datalen, value)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "char" "*paramname"
- .Sp "BYTE" "status"
- .Sp "int" "type"
- .Sp "DBINT" "maxlen"
- .Sp "DBINT" "datalen"
- .Sp "BYTE" "*value"
- .Co
- .Bl
- An application can call a stored procedure in two ways:
- by executing a command buffer containing a \*N EXECUTE statement or by making a
- remote procedure call (``rpc'').
- See the manual page for \f2dbrpcinit()\f1 for a discussion of
- the differences between these techniques.
- .Bl
- To make a remote procedure call,
- first call \f2dbrpcinit()\f1 to specify the stored procedure that's to be invoked.
- Then call \f2dbrpcparam()\f1 once for each of the stored procedure's parameters.
- Finally, call \f2dbrpcsend()\f1 to signify the end of the parameter list.
- This causes the server to begin executing the specified procedure.
- You can then call \f2dbsqlok()\f1, \f2dbresults()\f1, and \f2dbnextrow()\f1
- to process the stored procedure's results.
- (Note that you will need to call \f2dbresults()\f1 multiple times if the
- stored procedure contains more than one SELECT statement.)
- After all of the stored procedure's results have been processed,
- you can call the routines that process return parameters and status numbers,
- such as \f2dbretdata()\f1 and \f2dbretstatus()\f1.
- .Bl
- For an example of a remote procedure call,
- see Example 8 in the \f2\*L Reference Supplement\f1.
- .Bz
- .Pa
- .Pi dbproc
- A pointer to the DBPROCESS structure that provides the connection
- for a particular front-end/server process. It contains all the
- information that \*L uses to manage communications and data between the
- front end and the server.
- .Pi paramname
- A pointer to the name of the parameter to be invoked.
- This name must begin with the ``@'' symbol, which prefixes
- all stored procedure parameter names.
- As in the \*N EXECUTE statement, the name is optional.
- If it is not used, it should be specified as NULL.
- In that case, the order of the \f2dbrpcparam()\f1 calls
- determines the parameter to which each refers.
- .Pi status
- A one-byte bitmask of rpc-parameter options. So far, the only
- option available is DBRPCRETURN, which signifies that the
- application program would like this parameter used as
- a return parameter.
- .Pi type
- The datatype of the parameter (\f2e.g.,\f1 SYBINT1, SYBCHAR, etc.).
- .Pi maxlen
- For return parameters, this is the maximum desired byte length
- for the rpc parameter value returned from the stored procedure.
- \f2maxlen\f1 is relevant only for values whose datatypes are not fixed in length\(emthat is,
- character, text, binary, and image values.
- If this parameter doesn't apply (\f2i.e.,\f1 if the \f2type\f1 is a fixed length datatype such as
- SYBINT2) or if you don't care about restricting
- the lengths of return parameters, set \f2maxlen\f1 to -1.
- \f2maxlen\f1 should also be set to -1 for parameters not designated as return parameters.
- .Pi datalen
- The actual byte length of the rpc parameter value that gets sent to the stored procedure.
- \f2datalen\f1 must be used with values whose datatypes are not fixed in length; that is,
- character, text, binary, and image values.
- The byte length should \f2not\f1 count any null terminator.
- If this parameter doesn't apply (\f2i.e.,\f1 if the \f2type\f1 is a fixed length datatype such as
- SYBINT2), set \f2datalen\f1 to -1.
- If the value of the rpc parameter is NULL,
- you must set \f2datalen\f1 to 0,
- even if the \f2type\f1 is a fixed length datatype.
- .Pi value
- A pointer to the rpc parameter itself.
- If \f2datalen\f1 is 0, this pointer will be ignored and treated as NULL.
- .in -.375i
- .Re
- .br
- SUCCEED or FAIL.
- .Sa
- dbnextrow,
- dbresults,
- dbretdata,
- dbretstatus,
- dbrpcinit,
- dbrpcsend,
- dbsqlok
- .mc
-