IParameterSource Class Reference

This class exposes an interface for the DSI to interact with a parameter and associated metadata and data. More...

Inherits Simba::DSI::IParameterMetadata.

List of all members.

Public Member Functions

virtual const AttributeDataGetCustomField (simba_int16 in_fieldIdent) const =0
 Gets a custom metadata field from this type metadata. Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default TypeMetadata.
virtual simba_int16 GetDataSourceType () const =0
 Returns the data source-specific type identifier.
virtual EncodingType GetEncoding ()=0
 Returns the char or wchar encoding of the parameter.
virtual const void * GetInputData (simba_uint32 &out_length)=0
 Returns the input data buffer.
virtual SqlDataGetInputSqlData ()=0
 Returns the input data buffer.
virtual simba_int32 GetIntervalPrecision ()=0
 Returns the interval precision of the parameter.
virtual simba_uint32 GetLength ()=0
 Returns the column length of the parameter.
virtual const simba_wstringGetName ()=0
 Returns the name of the parameter.
virtual NumericPrecisionRadix GetNumPrecRadix ()=0
 Returns the NumPrecRadix of the parameter.
virtual simba_uint32 GetOctetLength ()=0
 Returns the Octet Length of the parameter.
virtual simba_uint16 GetParameterNumber ()=0
 Gets the index of this parameter, corresponding to the location of the parameter in the SQL query if it is unnamed.
virtual DSIParameterType GetParameterType ()=0
 Returns the DSIParameterType of the parameter.
virtual simba_int16 GetPrecision ()=0
 Returns the precision of the parameter.
virtual simba_int16 GetScale ()=0
 Returns the scale of the parameter.
virtual SqlDataGetSqlDataForOutput ()=0
 Returns a SqlData* used to store the output value for an output or input/output parameter.
virtual simba_int16 GetSqlType ()=0
 Returns the data type of the parameter.
virtual bool HasBindingChanged ()=0
 Indicates whether there is any changes on the binding of the parameter.
virtual bool IsCaseSensitive ()=0
 Indicates if the parameter is case sensitive or not.
virtual bool IsInputDefaultValue ()=0
 Indicates that the parameter's input value is "default".
virtual bool IsNull ()=0
 Indicates whether the buffer should be considered NULL.
virtual Simba::DSI::DSINullable IsNullable ()=0
 Indicates if the parameter is nullable or not.
virtual bool IsPushedValue ()=0
 Returns true if the input parameter value has already been passed in through calls to IQueryExecutor::PushParamData().
virtual bool IsUnnamed ()=0
 Indicates if the parameter is unnamed.
virtual bool IsUnsigned ()=0
 Returns if the data is unsigned or not.
virtual void SetCaseSensitive (bool in_caseSensitive)=0
 Sets the case-sensitivity of the parameter.
virtual void SetCustomField (simba_int16 in_fieldIdent, AutoPtr< AttributeData > in_attrValue) const =0
 Sets a custom metadata field on this type metadata Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default TypeMetadata.
virtual void SetEncoding (EncodingType in_encoding)=0
 Sets the char or wchar encoding of the parameter.
virtual void SetIntervalPrecision (simba_int32 in_precision)=0
 Sets the interval precision of the parameter.
virtual void SetLength (simba_uint32 in_length)=0
 Sets the column length of the parameter.
virtual void SetName (const simba_wstring &in_name)=0
 Sets the name field of parameter.
virtual void SetNullable (Simba::DSI::DSINullable in_nullable)=0
 Indicates if the parameter is nullable or not.
virtual void SetParameterType (DSIParameterType in_parameterType)=0
 Sets the DSIParameterType of the parameter.
virtual void SetPrecision (simba_int16 in_precision)=0
 Sets the precision field of the parameter.
virtual void SetScale (simba_int16 in_scale)=0
 Sets the scale field of the parameter.
virtual void SetSQLType (simba_int16 in_sqlType)=0
 Sets the data type of the parameter. This must be one of the SQL types such as SQL_INTEGER and SQL_VARCHAR.
virtual void SetUnnamed (bool in_unnamed)=0
 Indicates if the parameter is unnamed or not.
virtual void SetUnsigned (bool in_unsigned)=0
 Indicates if the parameter is unsigned or not.
virtual ~IParameterSource ()
 Destructor.

Protected Member Functions

 IParameterSource ()
 Constructor.

Detailed Description

This class exposes an interface for the DSI to interact with a parameter and associated metadata and data.

Certain methods are only available for IParameterSources passed in to the DSI in specific contexts. In other contexts they will throw BadStateExceptions.


Constructor & Destructor Documentation

virtual ~IParameterSource (  )  [inline, virtual]

Destructor.

IParameterSource (  )  [inline, protected]

Constructor.


Member Function Documentation

virtual const AttributeData& GetCustomField ( simba_int16  in_fieldIdent  )  const [pure virtual]

Gets a custom metadata field from this type metadata. Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default TypeMetadata.

Parameters:
in_fieldIdent Field identifier to get the type for.
Returns:
The AttributeData for in_fieldIdent.
virtual simba_int16 GetDataSourceType (  )  const [pure virtual]

Returns the data source-specific type identifier.

The meaning of this identifier depends on the DSI implementation.

Returns:
The data source-specific type identifier.
virtual EncodingType GetEncoding (  )  [pure virtual]

Returns the char or wchar encoding of the parameter.

Returns:
Char or wchar encoding of the parameter.

Implements IParameterMetadata.

virtual const void* GetInputData ( simba_uint32 &  out_length  )  [pure virtual]

Returns the input data buffer.

If IsNull() is false and fills in out_length with the number of bytes in the data buffer, or returns NULL if IsNull() is true and doesn't change out_length.

Parameters:
out_length Gets filled in with the number of bytes in the input data buffer if the data isn't NULL.
Exceptions:
BadStateException if called outside of IQueryExecutor::Execute() or IQueryExecutor::PushParamData().
NoDataInputParamException if IsInputDefaultValue() (or IsPushedValue() during execution) returns true , because in these cases there is no input data buffer.
ReadFromOutputParamException if, during execution, parameter is output only.
Returns:
Input data buffer. (NOT OWN)
virtual SqlData* GetInputSqlData (  )  [pure virtual]

Returns the input data buffer.

Returns:
The input SqlData object. (NOT OWN)
Exceptions:
BadStateException if called outside of IQueryExecutor::Execute().
NoDataInputParamException if IsInputDefaultValue() returns true (or IsPushedValue() during execution), because in these cases there is no input data buffer.
ReadFromOutputParamException if the parameter is output only.
virtual simba_int32 GetIntervalPrecision (  )  [pure virtual]

Returns the interval precision of the parameter.

Returns:
Interval precision of the parameter.

Implements IParameterMetadata.

virtual simba_uint32 GetLength (  )  [pure virtual]

Returns the column length of the parameter.

Returns:
Column length of the parameter.

Implements IParameterMetadata.

virtual const simba_wstring& GetName (  )  [pure virtual]

Returns the name of the parameter.

Returns:
Name of the parameter.

Implements IParameterMetadata.

virtual NumericPrecisionRadix GetNumPrecRadix (  )  [pure virtual]

Returns the NumPrecRadix of the parameter.

Returns:
NumPrecRadix of the parameter.

Implements IParameterMetadata.

virtual simba_uint32 GetOctetLength (  )  [pure virtual]

Returns the Octet Length of the parameter.

Returns:
Octet Length of the parameter.
virtual simba_uint16 GetParameterNumber (  )  [pure virtual]

Gets the index of this parameter, corresponding to the location of the parameter in the SQL query if it is unnamed.

Returns:
Index of the parameter.

Implements IParameterMetadata.

virtual DSIParameterType GetParameterType (  )  [pure virtual]

Returns the DSIParameterType of the parameter.

Returns:
DSIParameterType of the parameter.

Implements IParameterMetadata.

virtual simba_int16 GetPrecision (  )  [pure virtual]

Returns the precision of the parameter.

Returns:
Precision of the parameter.

Implements IParameterMetadata.

virtual simba_int16 GetScale (  )  [pure virtual]

Returns the scale of the parameter.

Returns:
Scale of the parameter.

Implements IParameterMetadata.

virtual SqlData* GetSqlDataForOutput (  )  [pure virtual]

Returns a SqlData* used to store the output value for an output or input/output parameter.

Call SetNull(true) on the provided SqlData* to indicate NULL data, or call SetLength() and then copy into the buffer provided by GetBuffer() to copy in data.

Exceptions:
BadStateException if called outside of IQueryExecutor::Execute().
WriteToDefaultParamException if the parameter source is an input only default parameter.
WriteToInputParamException if the parameter source is an input only parameter.
Returns:
SQLData instance used to store the output value for an output or input/output parameter. (NOT OWN)
virtual simba_int16 GetSqlType (  )  [pure virtual]

Returns the data type of the parameter.

Returns:
Data type of the parameter.

Implements IParameterMetadata.

virtual bool HasBindingChanged (  )  [pure virtual]

Indicates whether there is any changes on the binding of the parameter.

NOTE: Once execution has successfully returned, this must be set to false. That is, binding change only applies to one SQLExecute() call.

Returns:
True if any binding information has changed for the parameter, false otherwise.
virtual bool IsCaseSensitive (  )  [pure virtual]

Indicates if the parameter is case sensitive or not.

Returns:
True if the parameter is case-sensitive; false otherwise.

Implements IParameterMetadata.

virtual bool IsInputDefaultValue (  )  [pure virtual]

Indicates that the parameter's input value is "default".

Exceptions:
BadStateException if called outside of IQueryExecutor::Execute() or IQueryExecutor::PushParamData().
Returns:
True if the parameter's input value is "default"; false otherwise.
virtual bool IsNull (  )  [pure virtual]

Indicates whether the buffer should be considered NULL.

GetInputData() will return NULL if true.

Exceptions:
BadStateException if called outside of IQueryExecutor::Execute().
Returns:
True if the buffer should be considered NULL; false otherwise.
virtual Simba::DSI::DSINullable IsNullable (  )  [pure virtual]

Indicates if the parameter is nullable or not.

Returns:
The type of nullability for the parameter.

Implements IParameterMetadata.

virtual bool IsPushedValue (  )  [pure virtual]

Returns true if the input parameter value has already been passed in through calls to IQueryExecutor::PushParamData().

Exceptions:
BadStateException if called outside of IQueryExecutor::Execute().
Returns:
True if the input parameter value has been passed in through calls to IQueryExecutor::PushParamData(); false otherwise.
virtual bool IsUnnamed (  )  [pure virtual]

Indicates if the parameter is unnamed.

Returns:
True if the parameter is unnamed; false otherwise.

Implements IParameterMetadata.

virtual bool IsUnsigned (  )  [pure virtual]

Returns if the data is unsigned or not.

Returns:
True if the data is unsigned; false otherwise.

Implements IParameterMetadata.

virtual void SetCaseSensitive ( bool  in_caseSensitive  )  [pure virtual]

Sets the case-sensitivity of the parameter.

Parameters:
in_caseSensitive Set true if it is case-sensitive; false otherwise.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetCustomField ( simba_int16  in_fieldIdent,
AutoPtr< AttributeData in_attrValue 
) const [pure virtual]

Sets a custom metadata field on this type metadata Throws an exception if in_fieldIdent is not supported for this type metadata. Default implementation throws InvalidOperationException because no custom fields are supported for default TypeMetadata.

Parameters:
in_fieldIdent Field identifier to set the type for.
in_attrValue The AttributeData to set for in_fieldIdent.
virtual void SetEncoding ( EncodingType  in_encoding  )  [pure virtual]

Sets the char or wchar encoding of the parameter.

Parameters:
in_encoding Char or wchar encoding to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetIntervalPrecision ( simba_int32  in_precision  )  [pure virtual]

Sets the interval precision of the parameter.

The interval precision field is also affected by calls to SetSQLType() so this function should be used after the type is set to specify the interval precision.

Parameters:
in_precision The interval precision to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetLength ( simba_uint32  in_length  )  [pure virtual]

Sets the column length of the parameter.

The length field is also affected by calls to SetSQLType() so this function should be used after the type is set to specify the length.

Parameters:
in_length The column length to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetName ( const simba_wstring in_name  )  [pure virtual]

Sets the name field of parameter.

The name will be unused if SetUnnamed(true) is/was called.

Parameters:
in_name The name field to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetNullable ( Simba::DSI::DSINullable  in_nullable  )  [pure virtual]

Indicates if the parameter is nullable or not.

Parameters:
in_nullable The type of nullability for the parameter.

Implements IParameterMetadata.

virtual void SetParameterType ( DSIParameterType  in_parameterType  )  [pure virtual]

Sets the DSIParameterType of the parameter.

Parameters:
in_parameterType The DSIParameterType to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetPrecision ( simba_int16  in_precision  )  [pure virtual]

Sets the precision field of the parameter.

The precision is also affected by calls to SetSQLType() so this function should be used after the type is set to specify the precision.

Parameters:
in_precision The precision to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetScale ( simba_int16  in_scale  )  [pure virtual]

Sets the scale field of the parameter.

The scale is also affected by calls to SetSQLType() so this function should be used after the type is set to specify the scale.

Parameters:
in_scale The scale to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetSQLType ( simba_int16  in_sqlType  )  [pure virtual]

Sets the data type of the parameter. This must be one of the SQL types such as SQL_INTEGER and SQL_VARCHAR.

Setting the type has the following side effects on other fields:

  • Setting the type to SQL_CHAR or SQL_VARCHAR sets the length to 1 and precision to 1.
  • Setting the type to SQL_DATETIME sets the precision to 0 if the current SQL_DESC_DATETIME_INTERVAL_CODE is a code without a seconds component.
  • Setting the type to SQL_DATETIME sets the precision to 6 if the current SQL_DESC_DATETIME_INTERVAL_CODE is set to a code with a seconds component.
  • Setting the type to SQL_DECIMAL, SQL_NUMERIC, or SQL_FLOAT sets the scale to 0 and precision to the driver-defined value of 38.
  • Setting the type to SQL_INTERVAL sets the interval precision to 2 if the current SQL_DESC_DATETIME_INTERVAL_CODE is set to an interval.
  • Setting the type to SQL_INTERVAL sets the interval precision to 2 and sets the precision to 6 if the current SQL_DESC_DATETIME_INTERVAL_CODE is set to an interval with a seconds component.

There may be more side effects on length, interval precision, precision, and scale resulting from setting the SQLType so it is safer to set those after setting the type.

Parameters:
in_sqlType The data type to be set.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetUnnamed ( bool  in_unnamed  )  [pure virtual]

Indicates if the parameter is unnamed or not.

Parameters:
in_unnamed Set true if the parameter is unnamed; false otherwise.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

Implements IParameterMetadata.

virtual void SetUnsigned ( bool  in_unsigned  )  [pure virtual]

Indicates if the parameter is unsigned or not.

Parameters:
in_unsigned Set true if the parameter is unsigned; false otherwise.
Exceptions:
BadStateException if called outside of IQueryExecutor::PopulateParameters().

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

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