DSIExtTypeInfoMetadataSource Class Reference

Default implementation for data type information. More...

Inherits Simba::DSI::DSIMetadataSource.

List of all members.

Public Member Functions

void CloseCursor ()
 Closes the DSI's internal result cursor and clears associated memory.
 DSIExtTypeInfoMetadataSource (Simba::DSI::DSIMetadataRestrictions &in_restrictions, bool in_isODBCV3=true)
 Constructor.
bool GetMetadata (Simba::DSI::DSIOutputMetadataColumnTag in_columnTag, SqlData *in_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Fills in in_data with data for the given column in the current row.
bool Move (Simba::DSI::DSIDirection in_direction, simba_signed_native in_offset)
 Traverses the result set, moving on to the next row.
virtual ~DSIExtTypeInfoMetadataSource ()
 Destructor.

Protected Member Functions

void AddUserDataType (simba_uint16 in_userDataType)
 Adds a custom user data type to the vector of m_userDataTypes.
void InitializeSqlType (simba_int16 in_sqlType, SqlTypeInfo &io_typeInfo)
 Initializes the type information for the specified SQL type.
virtual void InitializeUserDataType (simba_uint16 in_userDataType, SqlTypeInfo &io_typeInfo)
 Initializes the type information for the specified custom user data type.
virtual
Simba::SQLEngine::TypePrepared 
PrepareType (Simba::SQLEngine::SqlTypeInfo &io_typeInfo)=0
 Takes the specified type information, modifies any fields that need to be changed to fit the data-source, and indicates if that type is supported or not.

Detailed Description

Default implementation for data type information.

This source contains the following output column tags as defined by SimbaEngine: DSI_DATA_TYPE_NAME_COLUMN_TAG DSI_DATA_TYPE_COLUMN_TAG DSI_COLUMN_SIZE_COLUMN_TAG DSI_LITERAL_PREFIX_COLUMN_TAG DSI_LITERAL_SUFFIX_COLUMN_TAG DSI_CREATE_PARAM_COLUMN_TAG DSI_NULLABLE_COLUMN_TAG DSI_CASE_SENSITIVE_COLUMN_TAG DSI_SEARCHABLE_COLUMN_TAG DSI_UNSIGNED_ATTRIBUTE_COLUMN_TAG DSI_FIXED_PREC_SCALE_COLUMN_TAG DSI_AUTO_UNIQUE_COLUMN_TAG DSI_LOCAL_TYPE_NAME_COLUMN_TAG DSI_MINIMUM_SCALE_COLUMN_TAG DSI_MAXIMUM_SCALE_COLUMN_TAG DSI_SQL_DATA_TYPE_COLUMN_TAG DSI_SQL_DATETIME_SUB_COLUMN_TAG DSI_NUM_PREC_RADIX_COLUMN_TAG DSI_INTERVAL_PRECISION_COLUMN_TAG DSI_USER_DATA_TYPE_COLUMN_TAG DSI_BEST_MATCH_COLUMN_TAG

The implementation of Move() must respond to the above mentioned columns.


Constructor & Destructor Documentation

DSIExtTypeInfoMetadataSource ( Simba::DSI::DSIMetadataRestrictions in_restrictions,
bool  in_isODBCV3 = true 
)

Constructor.

Parameters:
in_restrictions Restrictions that may be applied to the metadata table.
in_isODBCV3 Whether ODBC 3.X is in use.
virtual ~DSIExtTypeInfoMetadataSource (  )  [virtual]

Destructor.


Member Function Documentation

void AddUserDataType ( simba_uint16  in_userDataType  )  [protected]

Adds a custom user data type to the vector of m_userDataTypes.

This function should be called from the constructor to add each custom user data type to m_userDataTypes.

in_userDataType _MUST_ be an unsigned integer between 0x4000 and 0x7FFF

Parameters:
in_userDataType The simba_uint16 value identifying the user data type.
void CloseCursor (  )  [virtual]

Closes the DSI's internal result cursor and clears associated memory.

Implements DSIMetadataSource.

bool GetMetadata ( Simba::DSI::DSIOutputMetadataColumnTag  in_columnTag,
SqlData in_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [virtual]

Fills in in_data with data for the given column in the current row.

The target column is identified by in_columnTag which can be found in DSIMetadataColumnIdentifierDefns.h

Parameters:
in_columnTag Identifier that identifies a column.
in_data Holds a buffer to store the requested data.
in_offset Number of bytes in the data to skip before copying into in_data.
in_maxSize Maximum number of bytes of data to return in in_data.
Returns:
True if there is more data; false otherwise.

Implements DSIMetadataSource.

void InitializeSqlType ( simba_int16  in_sqlType,
SqlTypeInfo io_typeInfo 
) [protected]

Initializes the type information for the specified SQL type.

This function is not meant to be overridden. It is exposed as a helper function for the implementation of InitializeUserDataType().

Parameters:
in_sqlType The SQL type to initialize the specified SqlTypeInfo struct for.
io_typeInfo The struct to initialize with the defaults for the specified SQL type.
virtual void InitializeUserDataType ( simba_uint16  in_userDataType,
SqlTypeInfo io_typeInfo 
) [protected, virtual]

Initializes the type information for the specified custom user data type.

Each custom user data type has a base SQL type. For example, a CUSTOM_BLOB type could have a base SQL type of SQL_WLONGVARCHAR; MONEY could have a base SQL type of SQL_DECIMAL. InitializeType() is provided as a helper function to intialized default values for io_typeInfo.

This function is called from Move(). This default implementation always throws an InvalidOperationException as, by default, no custom user data types are supported. If the DSII supports any custom user data types, provide an implementation to handle each in_userDataType.

Parameters:
in_userDataType The simba_uint16 value identifying the user data type.
io_typeInfo The struct to initialize with the defaults for the specified user type.
bool Move ( Simba::DSI::DSIDirection  in_direction,
simba_signed_native  in_offset 
) [virtual]

Traverses the result set, moving on to the next row.

Parameters:
in_direction Direction to traverse through a result set
in_offset Number of bytes in the data to skip
Returns:
True if there are more rows to traverse; false if there are no more rows left.

Implements DSIMetadataSource.

virtual Simba::SQLEngine::TypePrepared PrepareType ( Simba::SQLEngine::SqlTypeInfo io_typeInfo  )  [protected, pure virtual]

Takes the specified type information, modifies any fields that need to be changed to fit the data-source, and indicates if that type is supported or not.

This function will be called at least once for each of the basic SQL data types with io_typeInfo filled in with the default information for the SQL type. The DSII should return one of the TypePrepared values as outlined below to indicate the level of support for the specified SQL type.

NOTE: This function will NOT get called for custom user data types. InitializeUserDataType() is expected to fully initialize the SqlTypeInfo for each custom user data type.

For example, if the data source does not support SQL_DOUBLE, it should return TP_NOT_SUPPORTED when the SqlTypeInfo representing SQL_DOUBLE is passed in.

TP_DUPLICATE may be returned if there is another type name with the same SQL type as the one returned in io_typeInfo that the DSII hasn't exposed yet in an earlier call to PrepareType.

Note that the type support outlined here will not necessarily define the types that can be returned in a result set. Simba SQL Engine can return all the basic types via implicit coercion or the CONVERT() scalar function. The type support outlined here is returned via SQLGetTypeInfo(), and is mainly used to determine type support in DDL. See this page for more information: http://msdn.microsoft.com/en-us/library/ms714632%28d=lightweight,v=VS.85%29.aspx

Parameters:
io_typeInfo The default type information for a SQL type.
Returns:
One of the TypePrepared enum values:
  • TP_NOT_SUPPORTED: The specified type is not supported by the data source.
  • TP_DONE: The specified type is supported by the data source.
  • TP_DUPLICATE: The specified type has an alias in the data source that has not yet been returned by PrepareType.

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:18 2017 for SimbaEngine 10.1.3.1011 by simba