SqlDataTypeUtilities Class Reference

This class contains methods that provide information about SQL types. More...

List of all members.

Public Member Functions

virtual simba_uint32 GetColumnSizeForSqlType (simba_int16 in_sqlType, bool in_isUnsigned=false)
 Gets the column size for the specified SQL data type.
virtual AttributeType GetCustomMetadataFieldType (simba_int16 in_fieldIdent)
 Indicates what data type this field identifier represents. The data type for in_fieldIdent must be the same for all custom types that support it so there is no in_type parameter. Returns ATTR_UINT32 by default.
simba_uint16 GetDBTYPEForSQLType (simba_int16 in_sqlType, bool in_isSigned)
 Returns the corresponding OLEDB DBTYPE for the given SQL data type.
simba_int16 GetIntervalCodeFromConciseType (simba_int16 in_conciseType)
 Gets the SQL interval code corresponding to the concise SQL type.
virtual simba_wstring GetStringForSqlType (simba_int16 in_sqlType)
 Returns the string representation of a SQL data type.
virtual simba_wstring GetStringForTDWType (TDWType in_tdwType)
 Returns the string representation of a TDW data type.
TDWType GetTDWTypeForSQLType (simba_int16 in_sqlType, bool in_isSigned)
 Returns the corresponding TDW type for the given SQL data type.
simba_int16 GetTypeForSqlTypeString (simba_wstring in_sqlTypeName)
 Returns the type identifier given the string representation of a SQL data type.
simba_int16 GetVerboseTypeFromConciseType (simba_int16 in_conciseType)
 Gets the verbose SQL type corresponding to the concise SQL type.
virtual bool IsAnyCharacterType (simba_int16 in_type)
 Indicates whether the given SQL type is a wide or non-wide character type.
virtual bool IsApproximateNumericType (simba_int16 in_type)
 Indicates whether the given SQL type is an approximate numeric type.
virtual bool IsBinaryType (simba_int16 in_type)
 Indicates whether the given SQL type is a binary type.
virtual bool IsCharacterOrBinaryType (simba_int16 in_type)
 Indicates whether the given SQL type is a character, wide character, or binary type.
virtual bool IsCharacterType (simba_int16 in_type)
 Indicates whether the given SQL type is a character type.
virtual bool IsDatetimeType (simba_int16 in_type)
 Indicates whether the given SQL type is a datetime type.
virtual bool IsExactNumericType (simba_int16 in_type)
 Indicates whether the given SQL type is an exact numeric type.
virtual bool IsGUIDType (simba_int16 in_type)
 Indicates if the given SQL type is GUID type.
virtual bool IsIntegerType (simba_int16 in_type)
 Indicates whether the given SQL type is an integer type.
virtual bool IsIntervalType (simba_int16 in_type)
 Indicates whether the given SQL type is an interval type.
virtual bool IsLOBType (simba_int16 in_type)
 Indicates whether the given SQL type is a large object (LOB) type.
virtual bool IsNumericType (simba_int16 in_type)
 Indicates whether the given SQL type is a numeric type.
virtual bool IsSupportedCustomMetadataField (simba_int16 in_type, simba_int16 in_fieldIdent)
 Indicates whether the given descriptor field identifier is valid for a given custom data type. Will return false if the given type is not a valid custom type or in_fieldIdent is not a valid field identifier for in_type. If this returns true, the SqlTypeMetadataFactory must be overridden to create a custom SqlTypeMetadata subclass that will accept getting and setting this field when creating metadata for the given type. This is not responsible for validating built in descriptor fields.
virtual bool IsSupportedCustomType (simba_int16 in_type)
 Indicates whether the given SQL type is a valid supported custom type.
virtual bool IsSupportedType (simba_int16 in_type)
 Indicates whether the given SQL type is a valid supported type.
virtual bool IsTimeType (simba_int16 in_type)
 Indicates whether the given SQL type is a time type.
virtual bool IsWideCharacterType (simba_int16 in_type)
 Indicates whether the given SQL type is a wide character type.
 SqlDataTypeUtilities ()
 Constructor.
virtual ~SqlDataTypeUtilities ()
 Destructor.

Detailed Description

This class contains methods that provide information about SQL types.

If you wish to support Custom Data Types, subclass from this class and override the virtual methods that apply to your Custom Data Types. There is no need to override a virtual method if it does not apply to your Custom Data Type.

NOTE: If you do override a method, you must include a call to the SqlDataTypeUtilities base method implementation to handle the standard SQL data types. For example:

bool CustomSqlDataTypeUtilities::IsCharacterType(simba_int16 in_type) { if (MY_CUSTOM_SQL_TYPE == in_type) { Return true/false if MY_CUSTOM_SQL_TYPE is a Character Type } else { Delegate handling of Standard SQL data types to base class implementation. return SqlDataTypeUtilities::IsCharacterType(in_type); } }

There is only one instance of this class. Access this instance via SqlDataTypeUtilitiesSingleton::GetInstance().


Constructor & Destructor Documentation

Constructor.

virtual ~SqlDataTypeUtilities (  )  [virtual]

Destructor.


Member Function Documentation

virtual simba_uint32 GetColumnSizeForSqlType ( simba_int16  in_sqlType,
bool  in_isUnsigned = false 
) [virtual]

Gets the column size for the specified SQL data type.

Parameters:
in_sqlType The SQL defined data type.
in_isUnsigned Indicates whether the type is unsigned. True if it is unsigned; false if it is signed. False by default.
Returns:
The column size for the specified SQL data type or 0 (zero) if the column uses a variable length data type.
virtual AttributeType GetCustomMetadataFieldType ( simba_int16  in_fieldIdent  )  [virtual]

Indicates what data type this field identifier represents. The data type for in_fieldIdent must be the same for all custom types that support it so there is no in_type parameter. Returns ATTR_UINT32 by default.

Parameters:
in_fieldIdent Field identifier to get the type for.
Returns:
The data type of the descriptor field for in_fieldIdent.
simba_uint16 GetDBTYPEForSQLType ( simba_int16  in_sqlType,
bool  in_isSigned 
)

Returns the corresponding OLEDB DBTYPE for the given SQL data type.

Parameters:
in_sqlType The SQL Type.
in_isSigned Whether it is a signed type.
Returns:
The corresponding OLEDB DBTYPE for the given SQL data type.
simba_int16 GetIntervalCodeFromConciseType ( simba_int16  in_conciseType  ) 

Gets the SQL interval code corresponding to the concise SQL type.

Parameters:
in_conciseType The concise SQL type.
Returns:
The interval SQL type corresponding to the given concise SQL type.
virtual simba_wstring GetStringForSqlType ( simba_int16  in_sqlType  )  [virtual]

Returns the string representation of a SQL data type.

Parameters:
in_sqlType The SQL Data Type.
Exceptions:
SupportException if the given SQL data type is invalid.
Returns:
The simba_wstring name for the given SQL data type.
virtual simba_wstring GetStringForTDWType ( TDWType  in_tdwType  )  [virtual]

Returns the string representation of a TDW data type.

Parameters:
in_sqlType The TDW Data Type.
Exceptions:
SupportException if the given TDW data type is invalid.
Returns:
The simba_wstring name for the given TDW data type.
TDWType GetTDWTypeForSQLType ( simba_int16  in_sqlType,
bool  in_isSigned 
)

Returns the corresponding TDW type for the given SQL data type.

Parameters:
in_sqlType The SQL Type.
in_isSigned Whether it is a signed type.
Returns:
The corresponding TDW type for the given SQL data type.
simba_int16 GetTypeForSqlTypeString ( simba_wstring  in_sqlTypeName  ) 

Returns the type identifier given the string representation of a SQL data type.

Note that this refers only to SQL type names and not the database type names.

Parameters:
in_sqlTypeName The string representation of the SQL Data Type.
Returns:
The concise SQL data type identifier, or SQL_UNKNOWN_TYPE if it is not recognized.
simba_int16 GetVerboseTypeFromConciseType ( simba_int16  in_conciseType  ) 

Gets the verbose SQL type corresponding to the concise SQL type.

Parameters:
in_conciseType The concise SQL type.
Returns:
The verbose SQL type corresponding to the given concise SQL type.
virtual bool IsAnyCharacterType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a wide or non-wide character type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is any one of the character types, false otherwise.
virtual bool IsApproximateNumericType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is an approximate numeric type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is SQL_REAL, SQL_FLOAT or SQL_DOUBLE, false otherwise.
virtual bool IsBinaryType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a binary type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is one of the binary types, false otherwise.
virtual bool IsCharacterOrBinaryType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a character, wide character, or binary type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is one of the binary or character types, false otherwise.
virtual bool IsCharacterType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a character type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is one of the character types, false otherwise.
virtual bool IsDatetimeType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a datetime type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQL_DATE, SQL_TIME or SQL_TIMESTAMP, false otherwise.
virtual bool IsExactNumericType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is an exact numeric type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is SQL_NUMERIC or SQL_DECIMAL, false otherwise.
virtual bool IsGUIDType ( simba_int16  in_type  )  [virtual]

Indicates if the given SQL type is GUID type.

Will return false if not GUID.

Parameters:
in_type The SQL type.
Returns:
True if the given it is SQL_GUID
virtual bool IsIntegerType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is an integer type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is one of the integer types, false otherwise.
virtual bool IsIntervalType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is an interval type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is SQL_REAL, SQL_FLOAT or SQL_DOUBLE, false otherwise.
virtual bool IsLOBType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a large object (LOB) type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if in_type is one of SQL_LONGVARCHAR, SQL_WLONGVARCHAR and SQL_LONGVARBINARY, false otherwise.
virtual bool IsNumericType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a numeric type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is a numeric type, false otherwise.
virtual bool IsSupportedCustomMetadataField ( simba_int16  in_type,
simba_int16  in_fieldIdent 
) [virtual]

Indicates whether the given descriptor field identifier is valid for a given custom data type. Will return false if the given type is not a valid custom type or in_fieldIdent is not a valid field identifier for in_type. If this returns true, the SqlTypeMetadataFactory must be overridden to create a custom SqlTypeMetadata subclass that will accept getting and setting this field when creating metadata for the given type. This is not responsible for validating built in descriptor fields.

Parameters:
in_type Data type of field to be checked
in_fieldIdent Descriptor field identifier to check if supported. 0x4001 is currently RESERVED by SimbaEngine SDK Documented in sbext.h - Definitions for extended attributes
Returns:
True if the given type is a descriptor field identifier.
virtual bool IsSupportedCustomType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a valid supported custom type.

Will return false if the given type is not a valid custom type. This is not responsible for validating builtin SQL types.

Parameters:
in_type The SQL type.
Returns:
True if the given type is a valid custom type.
virtual bool IsSupportedType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a valid supported type.

Will return false if the given type is not a valid type whether it is a custom type or a built-in SQL types.

Parameters:
in_type The SQL type.
Returns:
True if the given type is a valid type.
virtual bool IsTimeType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a time type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQL_TIME, or SQL_TIMESTAMP.
virtual bool IsWideCharacterType ( simba_int16  in_type  )  [virtual]

Indicates whether the given SQL type is a wide character type.

Will return false if the given type is not a valid SQL type.

Parameters:
in_type The SQL type.
Returns:
True if the given type is one of the wide character types, false otherwise.

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

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