Index

DKParametricQuery

Purpose:

DKParametricQuery is a concrete subclass of dkQuery, created by a datastore object to represent and execute a query involving parametric data. Parametric queries refer to a class of queries requiring an exact match of the query predicate, with the values stored in the datastore.

Class summary:

class DKParametricQuery : public dkQuery
{
  public:
   DKParametricQuery (dkDatastore* ds, const char* queryString);
   DKParametricQuery (dkDatastore* ds, DKCQExpr* queryExpr);
   DKParametricQuery(const DKParametricQuery& query);
   virtual ~DKParametricQuery();
 
   virtual void prepare(const DKNVPair* params = 0);
   virtual void execute(const DKNVPair* params = 0);
   virtual DKQueryStatus status();
   virtual DKAny result(DKBoolean fDelete = TRUE);
   virtual dkResultSetCursor* resultSetCursor();
   virtual unsigned long numberOfResults();
};

Members:

Constructors and destructor
   DKParametricQuery (dkDatastore* ds, const char* queryString);
   DKParametricQuery (dkDatastore* ds, DKCQExpr* queryExpr);
   DKParametricQuery(const DKParametricQuery& query);
   virtual ~DKParametricQuery();
 

DKParametricQuery object has three constructors. The first one takes its associated datastore and the query string. The second constructor takes its associated datastore and a query expression. The third constructor is a copy constructor. DKParametricQuery object may also be constructed by calling the createQuery() method on its associated datastore object.

Member functions

prepare
Stages or prepares the parameter-specific query.
virtual void prepare(const DKNVPair* params = 0);

execute
Executes the parameter-specific query. execute() supports an optional scope parameter supplied in DLNVPair. If this is specified, the query scope is used to filter the returned query results. The result is obtained by calling result().
virtual void execute(const DKNVPair* params = 0);

status
Get the status of a query.
virtual DKQueryStatus status();

result
Returns the result pointer to the caller. The result is a DKAny object, which contains a pointer to the DKResults object. The DKResults object is a collection of DKAny objects. The value of any of these DKAny objects is a pointer to a DKDDO object, which represents a document or folder.
virtual DKAny result(DKBoolean fDelete = TRUE);
 

resultSetCursor
Returns the result in a dkResultSetCursor object.
virtual dkResultSetCursor* resultSetCursor();
 

numberOfResults
Returns the number of query results.
virtual unsigned long numberOfResults();
 

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.