Function odbc_sys::SQLGetStmtAttrW

source ·
pub unsafe extern "system" fn SQLGetStmtAttrW(
    handle: HStmt,
    attribute: StatementAttribute,
    value_ptr: Pointer,
    buffer_length: Integer,
    string_length_ptr: *mut Integer
) -> SqlReturn
Expand description

Returns the current setting of a statement attribute.

A call to SQLGetStmtAttr returns in value the value of the statement attribute specified in attribute. That value can either be a ULen value or a null-terminated character string. If the value is a ULen value, some drivers may only write the lower 32-bit or 16-bit of a buffer and leave the higher-order bit unchanged. Therefore, applications should use a buffer of ULen and initialize the value to 0 before calling this function. Also, the buffer_lengthandstring_lengtharguments are not used. If the value is a null-terminated string, the application specifies the maximum length of that string in thebuffer_lengthargument, and the driver returns the length of that string in thestring_length` buffer.

To allow applications calling SQLGetStmtAttr to work with ODBC 2.x drivers, a call to SQLGetStmtAttr is mapped in the Driver Manager to SQLGetStmtOption. The following statement attributes are read-only, so can be retrieved by SQLGetStmtAttr, but not set by SQLSetStmtAttr:

  • StatementAttribute::ImpParamDesc
  • StatementAttribute::ImpRowDesc
  • StatementAttribute::RowNumber

Returns

SUCCESS, SUCCESS_WITH_INFO, ERROR, or INVALID_HANDLE.