Developing Database Drivers for AOLserver -- Ns_PdDbSetMaxRows

### Ns_PdDbSetMaxRows

#### Overview

Set the max rows for the database.

#### Syntax

        void Ns_PdDbSetMaxRows(void *handle);

#### Description

This function sets the max rows for the database if the DBMS supports it. If this function is successful or the SQL command is undefined for your specific DBMS, it should call Ns_PdSendString with an OK_STATUS. If set-max-rows is defined for your specific DBMS and there is an exception raised, then this function should send an exception code with Ns_PdSendException. If this function is undefined for the DBMS, then this function should call Ns_PdSendString with an OK_STATUS.

#### Psuedo-code Example

        /* Things italicized would be your DBMS-specific structures and
    calls. */
        void
        Ns_PdDbSetMaxRows(void *handle, char *maxRows) {
            DBMSState *state = (DBMSState *)handle;
            Ns_PdLog(Trace, "setmaxrows:");
            sprintf(state->sqlbuf, "set rowcount %s", maxRows);
            if (DBMSExec(state, state->sqlbuf) != DB_DML) {
                Ns_PdLog(Error, "DbSetMaxRows: Exec(%s) failed",
        state->sqlbuf);
                Ns_PdSendException(state->exceptionCode,
        state->exceptionMsg);
            }
            Ns_PdSendString(OK_STATUS);
        }

Top of Page
Copyright © 1998-99 America Online, Inc.