Class: TSQLCommandHandle

Declaration: SQLDataAccess.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TSQLSimpleCommandHandle

Inherited By:

None.

Purpose:

This concrete class is a counted pointer surrogate for TSQLCommand. It extends the semantics of TSQLSimpleCommandHandle by supporting parameterized SQL statements. As a result, most clients will find TSQLCommandHandle class more useful than TSQLSimpleCommandHandle or TSQLNativeCommandHandle. Clients obtain SQL command handles from appropriate derived classes such as TSQLStandardCommandHandle.

Instantiation:

Always allocate on the stack.

Deriving Classes:

Providers who supply such classes need to use the following constructors: TSQLCommandHandle(TSQLCommand&); TSQLCommandHandle(const TSQLCommandHandle& source); TSQLCommandHandle& operator =(const TSQLCommandHandle& right);

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TSQLCommandHandle::TSQLCommandHandle

  1. TSQLCommandHandle ()
  2. TSQLCommandHandle (const TSQLCommandHandle & source)
  3. TSQLCommandHandle (TSQLCommand &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Instantiates and initializes an object.

Calling Context:

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

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSQLCommandHandle::~TSQLCommandHandle

virtual ~ TSQLCommandHandle ()

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: TSQLCommandHandle::operator=

TSQLCommandHandle & operator =(const TSQLCommandHandle & 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: TSQLCommandHandle::Execute

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

Interface Category:

API.

Purpose:

  1. Executes the SQL command.
  2. Inserts 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: TSQLCommandHandle::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: TSQLCommandHandle::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: TSQLCommandHandle::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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.