[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_PdDbSpSetParam

Overview

Set parameters for stored procedure

Syntax

    void Ns_PdDbSpSetParam (void *handle, char *args)

Description

This function sets parameters in a stored procedure before executing it.

Psuedo-code Example

    void
    Ns_PdDbSpSetParam (void *handle, char *args)
    {
        DBMSState   *state = (DBMSState *) ahndle;
        char        *paramname, *paramtype, *inout, *value;
        static char  delim = ' ';
    
        if (state->cmd == NULL) {
            Ns_PdLog(Error, "DbSpSetParam: spsetparam called before 
spstart");
            Ns_PdSendString("spsetparam called before spstart");
            return;
        }
    
        paramname = args;
        paramtype = strchr(paramname, delim);
        *paramtype = '\0';  paramtype++;
        inout     = strchr(paramtype, delim);
        *inout = '\0';  inout++;
        value     = strchr(inout, delim);
        *value = '\0';  value++;
    
        if (DBMSParam(state, paramname, paramtype, inout, value) != 
DBMS_OK) {
        if (retcode != CS_SUCCEED) {
            Ns_PdLog(Error, "DbSpSetParam: ct_param() failed for arg 
%s.",
                            paramname);
            Ns_PdSendException(state->exceptionCode, state->exceptionMsg);

            return;
        }
    
        Ns_PdSendString(OK_STATUS);
    }

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.