|   | ![[ Previous ]](navbprev.gif)  ![[ Contents ]](navbhome.gif)  ![[ Index ]](navbhelp.gif)  ![[ Next ]](navbnext.gif)  | 
Set parameters for stored procedure
void Ns_PdDbSpSetParam (void *handle, char *args)
This function sets parameters in a stored procedure before executing it.
    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);
    }