Class: TSQLCommand

Declaration: SQLDataAccess.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MReferenceCounted

Inherited By:

None.

Purpose:

TSQLCommand is an abstract class. Each connection can be associated with one or more command objects that are responsible for the execution of individual SQL commands. Each command object embodies a parameterized and bound SQL statement and is associated with the code required to process that statement for a given database protocol/server combination. (For example, SQL*Net to Oracle 7, or ODBC to Rdb.)

Instantiation:

Abstract class; do not instantiate.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TSQLCommand::~TSQLCommand

virtual ~ TSQLCommand ()

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: TSQLCommand::Execute

  1. virtual void Execute ()
  2. virtual void Execute (TRecordSourceHandle &)

Interface Category:

API.

Purpose:

  1. Executes the SQL command.
  2. This variant of the command lets the client insert data in bulk. The actual SQL command must be a parameterized INSERT statement.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TSQLClientError exceptions when there is a syntax error.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLCommand::GetRecordSource

virtual const TRecordSourceHandle & GetRecordSource (TRecordSourceHandle &) const

Interface Category:

API.

Purpose:

Returns the record source for the executed SQL command. Throws an exception if the given command was not a SELECT statement or was not executed.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The record source for the SQL command.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLCommand::InitializeStatement

virtual void InitializeStatement ()

Interface Category:

API.

Purpose:

Postconstruction initialization.

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: TSQLCommand::Parameter

virtual TSQLParameterHandle Parameter (TSQLParameter :: Position)

Interface Category:

API.

Purpose:

Creates a parameter handle that can be used to bind an SQL constant to a command parameter.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The newly created parameter handle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLCommand::GetParameter

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

Interface Category:

API.

Purpose:

Returns the value of the given parameter. An empty parameter results in an empty text object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A const reference to the given parameter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLCommand::GetSQLStatement

virtual const TSQLStatement & GetSQLStatement (TSQLStatement &) const

Interface Category:

API.

Purpose:

Returns the associated SQL statement object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A const reference to the associated SQL statement object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLCommand::DefineResultColumn

virtual void DefineResultColumn (TRecordSource :: ColumnPosition, TRecordSource :: ColumnType, const TText &)

Interface Category:

API.

Purpose:

Specifies the data type of a column in a record source expected from the datastore as result of executing a data retrieval command (for example, SELECT).

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: TSQLCommand::TSQLCommand

  1. TSQLCommand (const TText & sql =TStandardText :: GetEmptyText ())
  2. TSQLCommand (const TSQLCommand & source)

Interface Category:

API.

Purpose:

  1. Constructs a command and initializes its associated SQL statement.
  2. Copy constructor.

Calling Context:

  1. Call this function directly.
  2. 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: TSQLCommand::operator=

TSQLCommand & operator =(const TSQLCommand & 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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.