Returns a list of schema rowsets accessible by IDBSchemaRowset::GetRowset.
HRESULT GetSchemas ( ULONG *pcSchemas, GUID **prgSchemas, ULONG **prgRestrictionSupport);
Parameters
The value of prgRestrictionSupport reflects on which of the columns listed as restriction columns the provider supports restrictions. The table of GUID restriction columns earlier in the overview of IDBSchemaRowset indicates the array of possible restriction columns to which this bitmask applies.
For example, the GUID table at the beginning of this reference entry lists three restriction columns for the schema DBSCHEMA_ASSERTIONS. The array element corresponding to this schema will represent the CONSTRAINT_CATALOG column in bit 0, the CONSTRAINT_SCHEMA column in bit 1, and the CONSTRAINT_NAME column in bit 2. The following code shows how the consumer might determine whether a restriction on the CONSTRAINT_CATALOG column is supported on the ASSERTIONS schema rowset.
ULONG cSchemas; GUID * rgSchemas; ULONG * rgRestSupport; pIDBSchemaRowset->GetSchemas(&cSchemas, &rgSchemas, &rgRestSupport); // Assume rgSchemas[0] is the GUID DBSCHEMA_ASSERTIONS. The following // code checks whether the restriction on the CONSTRAINT_CATALOG // column is supported. if (rgRestSupport[0] & 0x1) { // Restriction is supported. } else { // Restriction is not supported. }
The session allocates memory for the restrictions and returns the address to this memory. The consumer releases this memory with IMalloc::Free when it no longer needs the list of restrictions. If an error occurs, *prgRestrictionSupport is set to a null pointer.
If prgRestrictionSupport is a null pointer, the session does not allocate any memory or return any restrictions.
Return Code