dbregparam

Description

Define or describe a registered procedure parameter.

Syntax

RETCODE dbregparam(dbproc,param_name, type, datalen, 
                 data)
 
DBPROCESS     *dbproc;
char                    *param_name;
int                        type;
DBINT                datalen;
BYTE                 *data;

Parameters

dbproc

A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library/C uses to manage communications and data between the front end and the server.

param_name

A pointer to the parameter name.

When creating a registered procedure, param_name is required.

When executing a registered procedure, param_name may be NULL. In this case, the registered procedure will expect to receive its parameters in the order in which they were originally defined.

type

A symbolic value indicating the datatype of the parameter. Legal data types are: SYBINT1, SYBINT2, SYBINT4, SYBREAL, SYBFLT8, SYBCHAR, SYBBINARY, SYBVARCHAR, SYBDATETIME4, SYBDATETIME, SYBMONEY4, and SYBMONEY.

Note that SYBTEXT and SYBIMAGE are not legal datatypes for parameters.

datalen

The length of the parameter.

When creating a registered procedure:

  • datalen can be used to indicate that no default value is being supplied for this parameter. To indicate no default, pass datalen as DBNODEFAULT.

  • datalen can be used to indicate that the default value for a parameter is NULL. This is different from having no default. To indicate a NULL default, pass datalen as 0.

When executing a registered procedure:

  • datalen may be 0. In this case, data is ignored and NULL is passed to the registered procedure for this parameter.

data

A pointer to the parameter.

When creating a registered procedure, data can be used to provide a default value for the parameter. Pass data as pointing to the default value. If no default value is desired, pass datalen as DBNODEFAULT.

When executing a registered procedure, data may be passed as NULL.

Returns

SUCCEED or FAIL.

Usage

See also

dbreginit, dbregexec, dbnpdefine, dbnpcreate, dbregwatch