ISSCommandWithParameters::GetParameterProperties (OLE DB)


System_CAPS_ICON_warning.jpg Warning

SQL Server Native Client (SNAC) is not supported beyond SQL Server 2012. Avoid using SNAC in new development work, and plan to modify applications that currently use it. The Microsoft ODBC Driver for SQL Server provides native connectivity from Windows to Microsoft SQL Server and Microsoft Azure SQL Database.

Returns an array of SSPARAMPROPS property set structures, one SSPARAMPROPS property set for each UDT or XML parameter.

HRESULT GetParameterProperties(  
      DB_UPARAMS *pcParams,  
      SSPARAMPROPS **prgParamProperties);  

A pointer to memory that contains the number of SSPARAMPROPS structures returned in prgParamProperties.

A pointer to memory in which an array of SSPARAMPROPS structures is returned. The provider allocates memory for the structures and returns the address to this memory; the consumer releases this memory with IMalloc::Free when it no longer needs the structures. Before calling IMalloc::Free for prgParamProperties, the consumer must also call VariantClear for the vValue property of each DBPROP structure in order to prevent a memory leak in cases where the variant contains a reference type (such as a BSTR.) If pcParams is zero on output or an error other than DB_E_ERRORSOCCURRED occurs, the provider does not allocate any memory and ensures that prgParamProperties is a null pointer on output.

The GetParameterProperties method returns the same error codes as the core OLE DB ICommandProperties::GetProperties method, except that DB_S_ERRORSOCCURRED and DB_E_ERRORSOCCURED cannot be raised.

ISSCommandWithParameters::GetParameterProperties behaves consistently with respect to GetParameterInfo. If ISSCommandWithParameters::SetParameterProperties or SetParameterInfo have not been called or have been called with cParams equal to zero, GetParameterInfo derives parameter information and returns this. If ISSCommandWithParameters::SetParameterProperties or SetParameterInfo have been called for at least one parameter, ISSCommandWithParameters::GetParameterProperties returns properties only for those parameters for which ISSCommandWithParameters::SetParameterProperties has been called. If ISSCommandWithParameters::SetParameterProperties is called after ISSCommandWithParameters::GetParameterProperties or GetParameterInfo, subsequent calls to ISSCommandWithParameters::GetParameterProperties return the overridden values for those parameters for which ISSCommandWithParameters::SetParameterProperties has been called.

The SSPARAMPROPS structure is defined as follows:



ULONG cPropertySets;

DBPROPSET *rgPropertySets;


iOrdinalThe ordinal of the passed parameter.
cPropertySetsThe number of DBPROPSET structures in rgPropertySets.
rgPropertySetsA pointer to memory in which to return an array of DBPROPSET structures.

ISSCommandWithParameters (OLE DB)

Community Additions