AEParameter Class Reference

A class that models a SQL dynamic parameter. More...

Inherits AETerminalExprT< AEValueExpr >.

List of all members.

Public Member Functions

virtual void AcceptVisitor (AENodeVisitor &in_visitor)
 Calls the correct method on the visitor.
 AEParameter (const AEParameter &in_other)
 Copy constructor.
 AEParameter (simba_uint16 in_index, bool in_useDefault, Simba::SQLEngine::DSIExtDataEngineContext *in_deContext)
 Constructor.
virtual AEParameterClone () const
 Creates a clone of this node object.
virtual const AEParameterGetAsParameter () const
 Retrieves the object as an AEParameter object.
virtual AEParameterGetAsParameter ()
 Retrieves the object as an AEParameter object.
simba_uint16 GetIndex () const
 Returns the index of the parameter.
const void * GetInputData (simba_uint32 &out_length)
 Gets the input parameter data.
virtual simba_wstring GetLogString () const
 Returns a string name for this node for the purpose of logging.
virtual SqlTypeMetadataGetMetadata () const
 Returns a SqlTypeMetadata* describing the column.
virtual AENodeType GetNodeType () const
 Returns an integer that uniquely identifies the node class. See the definition of AENodeType for values defined.
Simba::DSI::DSINullable GetNullable () const
 Returns the nullability of the parameter.
SqlDataGetOutputData ()
 Gets the output parameter data.
Simba::DSI::DSIParameterType GetParameterType () const
 Returns the type of the parameter: DSI_PARAM_INPUT, DSI_PARAM_OUTPUT, or DSI_PARAM_INPUT_OUTPUT.
bool HasDefaultValue () const
 Indicates whether there is a default value for the parameter.
bool IsStaticDefault () const
 Indicates whether this parameter was a default parameter in the query string, (as opposed to a dynamic parameter bound with a value of SQL_DEFAULT_PARAM.
void SetIndex (simba_uint16 in_index)
 Sets the index of the parameter.
void SetInputData (const void *in_data, simba_uint32 in_length)
 Sets the input parameter data.
void SetMetadata (SqlTypeMetadata *in_metadata)
 Sets the SqlTypeMetadata* describing the parameter.
void SetOutputData (SqlData *in_outData)
 Sets the output parameter data.
void SetUseDefaultValue (bool in_useDefault)
 Set whether the default value for this parameter should be used.
bool UseDefaultValue () const
 Indicates whether the default value for this parameter should be used.
bool ValueVariesDuringExecution () const
 Check if the value of this parameter may vary during execution (due to, for example, the use of parameter arrays).
virtual ~AEParameter ()
 Destructor.

Protected Member Functions

virtual bool IsEqual (const AENode *in_another) const
 Tests whether two nodes are "equal".

Friends

class ETResultFactory

Detailed Description

A class that models a SQL dynamic parameter.

NOTE: This node itself won't know anything about the columns that it should be acting on. Hence, the majority of the member methods that inherits from IColumn throws SEInvalidOperationException.

Will always have no children (GetChildCount() returns 0).


Constructor & Destructor Documentation

AEParameter ( simba_uint16  in_index,
bool  in_useDefault,
Simba::SQLEngine::DSIExtDataEngineContext in_deContext 
)

Constructor.

Parameters:
in_index The index of this parameter in the SQL statement. See GetIndex() for more information.
in_useDefault Indicates whether this parameter should use the default value.
in_deContext The current DataEngine context. (NOT OWN)
AEParameter ( const AEParameter in_other  ) 

Copy constructor.

To support "cloning". See Clone() method.

Parameters:
in_other The other node to create a copy from.
virtual ~AEParameter (  )  [virtual]

Destructor.


Member Function Documentation

virtual void AcceptVisitor ( AENodeVisitor in_visitor  )  [virtual]

Calls the correct method on the visitor.

Parameters:
in_visitor The visiting object.

Implements AENode.

virtual AEParameter* Clone (  )  const [virtual]

Creates a clone of this node object.

Returns:
A clone of this node object. (OWN)

Implements AEValueExpr.

virtual const AEParameter* GetAsParameter (  )  const [inline, virtual]

Retrieves the object as an AEParameter object.

This default implementation always throws an exception. The appropriate sub-class must override this method.

Exceptions:
SEInvalidOperationException if this object is not of expected type.
Returns:
this object as an AEParameter object. (NOT OWN)

Reimplemented from AEValueExpr.

virtual AEParameter* GetAsParameter (  )  [inline, virtual]

Retrieves the object as an AEParameter object.

This default implementation always throws an exception. The appropriate sub-class must override this method.

Exceptions:
SEInvalidOperationException if this object is not of expected type.
Returns:
this object as an AEParameter object. (NOT OWN)

Reimplemented from AEValueExpr.

simba_uint16 GetIndex (  )  const

Returns the index of the parameter.

The index corresponds to the position in which the parameter appears in the SQL statement. The first parameter that appears in the statement (reading from a left-to-right direction) corresponds to index 1, the second parameter corresponds to index 2, and so forth.

Default parameters (for stored procedures) have an index of SIMBA_UINT16_MAX.

Returns:
The index of the parameter in the SQL statement.
const void* GetInputData ( simba_uint32 &  out_length  ) 

Gets the input parameter data.

Parameters:
out_length The length of the input data in bytes. 0 if in_data is NULL.
Returns:
The actual input data. (NOT OWN)
Exceptions:
If ValueVariesDuringExecution() returns true.
virtual simba_wstring GetLogString (  )  const [virtual]

Returns a string name for this node for the purpose of logging.

Returns:
A string representation of this node for logging purposes.

Implements AENode.

virtual SqlTypeMetadata* GetMetadata (  )  const [virtual]

Returns a SqlTypeMetadata* describing the column.

Exceptions:
throws SEInvalidOperationException when SqlTypeMetadata is null.
Returns:
the SqlTypeMetadata for this ValueExpr node. (NOT OWN)

Reimplemented from AEValueExpr.

virtual AENodeType GetNodeType (  )  const [virtual]

Returns an integer that uniquely identifies the node class. See the definition of AENodeType for values defined.

Returns:
The ID that uniquely identifies this type of nodes.

Implements AENode.

Simba::DSI::DSINullable GetNullable (  )  const

Returns the nullability of the parameter.

Returns:
The nullability of the parameter.
SqlData* GetOutputData (  ) 

Gets the output parameter data.

Returns:
A pointer to the SqlData to place the output data into. (NOT OWN)
Simba::DSI::DSIParameterType GetParameterType (  )  const

Returns the type of the parameter: DSI_PARAM_INPUT, DSI_PARAM_OUTPUT, or DSI_PARAM_INPUT_OUTPUT.

Returns:
the type of the parameter.
bool HasDefaultValue (  )  const

Indicates whether there is a default value for the parameter.

Returns:
True if there is a default value for the parameter; false otherwise.
virtual bool IsEqual ( const AENode in_another  )  const [protected, virtual]

Tests whether two nodes are "equal".

Parameters:
in_another Another node to compare to. (NOT OWN)
Returns:
true if two nodes are equal, false otherwise.

Reimplemented from AENode.

bool IsStaticDefault (  )  const

Indicates whether this parameter was a default parameter in the query string, (as opposed to a dynamic parameter bound with a value of SQL_DEFAULT_PARAM.

Returns:
True if this is was specified as a default parameter in the query string.
void SetIndex ( simba_uint16  in_index  ) 

Sets the index of the parameter.

The index corresponds to the position in which the parameter appears in the SQL statement. The first parameter that appears in the statement (reading from a left- to-right direction) corresponds to index 1, the second parameter corresponds to index 2, and so forth.

NOTE that SetIndex() must be called if there are default parameter(s) in the SQL statement. A default parameter is not considered a parameter and thus the indices of all non-default parameters _MUST_ be updated.

For example: {call parameters(, ?, ?)} has 2 parameters. The AEProcessor builds an AEParameter for the first parameter, even though it is a default parameter. Initially, its index is 1, the second parameter is index 2, and the third is index 3. When it is determined that the first parameter is a default parameter, the indices of the second and third parameters must be updated to 1, and 2 respectively.

Parameters:
in_index The updated index of the parameter.
void SetInputData ( const void *  in_data,
simba_uint32  in_length 
)

Sets the input parameter data.

Parameters:
in_data The actual input data. (NOT OWN)
in_length The length of the input data in bytes. 0 if in_data is NULL.
void SetMetadata ( SqlTypeMetadata in_metadata  ) 

Sets the SqlTypeMetadata* describing the parameter.

This overwrites the previous metadata for the parameter.

Exceptions:
throws SESqlErrorException when in_metadata is null.
Parameters:
in_metadata The SqlTypeMetadata describing this parameter. (OWN)
void SetOutputData ( SqlData in_outData  ) 

Sets the output parameter data.

Parameters:
in_outData A pointer to the SqlData to place the output data into. (NOT OWN)
void SetUseDefaultValue ( bool  in_useDefault  ) 

Set whether the default value for this parameter should be used.

Parameters:
in_useDefault True if the default value for this parameter should be used; false otherwise.
bool UseDefaultValue (  )  const

Indicates whether the default value for this parameter should be used.

Returns:
True if the default value for this parameter should be used; false otherwise.
Exceptions:
If ValueVariesDuringExecution() returns true.
bool ValueVariesDuringExecution (  )  const

Check if the value of this parameter may vary during execution (due to, for example, the use of parameter arrays).

Note: If this method returns true, calls to UseDefaultValue() and GetInputData() will throw an exception.


Friends And Related Function Documentation

friend class ETResultFactory [friend]

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

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