DbiQAlloc

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiQAlloc

Return to chapter overview

C syntax

DBIResult DBIFN DbiQAlloc (hDb, eQryLang, phStmt);

Delphi syntax

function DbiQAlloc (hDb: hDBIDb; eQryLang: DBIQryLang; var hStmt: hDBIStmt): DBIResult stdcall;

Description

DbiQAlloc allocates a statement handle required by query prepare functions.

Parameters

hDb                Type: hDBIDb                (Input
Specifies the database handle

eQryLang                Type: DBIQryLang                (Input)
Specifies the query language, "qrylangSQL" or "qrylangQBE".

phStmt                Type: phDBIStmt                (Output)
Provides the pointer to the statement handle.

Usage

This function must be called before calling DbiQPrepare in order to obtain a new statement handle. It allows you to set properties to control the query execution process before calling the next function. All query process procedures must follow this pattern:

DbiQAlloc

…  // Other query preparation and execution functions.

DbiQFree

This is the only way to do query process procedures.

If you want the query to return an updateable record set, use the following sequence of calls:

DbiQAlloc( hDb, eQryLang, &phStmt );

DbiSetProp( hStmt, stmtLIVENESS, wantLIVE (or wantCANNED) );

DbiQPrepare( hStmt, pszQuery );

In every case, after you have prepared and executed the query, call DbiQFree to free the resources allocated to this query (right after DbiQExec).

DbiResult

Meaning

DBIERR_NONE

The statement handle was returned.

See also

DbiQPrepare, DbiQExec, DbiQFree, DbiQSetParams