Class: TSQLStatement

Declaration: SQLDataAccess.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TSQLStandardStatement

Purpose:

This abstract class is a utility class for clients and providers that analyzes the structure of a Base Client SQL statement. Statement objects do not require a connection. Statement objects can be created directly or can be obtained from any command object.

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

See TSQLStandardStatement for a concrete implementation.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TSQLStatement::TSQLStatement

  1. TSQLStatement ()
  2. TSQLStatement (const TText &)
  3. TSQLStatement (const TSQLStatement & source)

Interface Category:

API.

Purpose:

  1. Default constructor. Constructs an invalid object.
  2. Constructs a statement initialized with the text argument.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and any other function that needs to construct an uninitialized object.
  2. Call this function directly.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::~TSQLStatement

virtual ~ TSQLStatement ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::operator=

virtual TSQLStatement & operator =(const TSQLStatement & right)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetSQL

virtual const TText & GetSQL (TText &, const TSQLHint & hint =TSQLHint :: GetEmptyHint ()) const

Interface Category:

API.

Purpose:

Returns the SQL statement, with bound parameter values, that is currently associated with the command. The client reference value is returned for use in a functional expression.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A const reference to the SQL statement.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetSQLWithPlaceholders

virtual const TText & GetSQLWithPlaceholders (TText &) const

Interface Category:

API.

Purpose:

Returns the SQL statement, with placeholders currently associated with the command.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The client reference value is returned for use in a functional expression.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::SetSQL

virtual void SetSQL (const TText &)

Interface Category:

API.

Purpose:

Sets the SQL statement to that passed in, replacing any existing SQL statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetStatementType

virtual const StatementType & GetStatementType (StatementType &) const

Interface Category:

API.

Purpose:

Returns the type of the given statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The type of the given statement.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetStatementTypeHint

virtual EStatementTypeHint GetStatementTypeHint () const

Interface Category:

API.

Purpose:

Returns the enumerated type of the given statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The enumerated type of the statement.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetColumnName

virtual const TText & GetColumnName (ColumnPosition, TText &) const

Interface Category:

API.

Purpose:

Returns the specified result column name (or expression) for the SELECT statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The column name.

Exceptions:

Raises an exception if the statement is not a SELECT statement, or the column position is out of range.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetColumnAlias

virtual const TText & GetColumnAlias (ColumnPosition, TText &) const

Interface Category:

API.

Purpose:

Returns the specified result column alias for the SELECT statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns TStandardText::GetEmptyText if the statement is not a SELECT statement, or the column position is out of range.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetColumnCount

virtual ColumnCount GetColumnCount () const

Interface Category:

API.

Purpose:

Returns the number of columns in the given SELECT statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The number of columns in the given SELECT statement.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::SetParameter

virtual void SetParameter (TSQLParameter :: Position, const TText &)

Interface Category:

API.

Purpose:

Sets the value of the specified parameter in a statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetParameter

virtual const TText & GetParameter (TSQLParameter :: Position, TText &) const

Interface Category:

API.

Purpose:

Returns the current value of the specified parameter in a statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A constant reference to the requested parameter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLStatement::GetParameterCount

virtual ParameterCount GetParameterCount () const

Interface Category:

API.

Purpose:

Returns the number of parameters in the SQL statement.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The number of parameters in the SQL statement.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.