GetQueryText()


" "

BSTR GetQueryText(long QueryID)

Description

This function returns the SQL text that is executed for the specified query, after variable substitution. You should use SetVariable() to set the value of any variables used in the query before calling this function.

Parameters

Name Description
QueryID

The ID of the query, as returned from InitializeQuery().

Note:
The query text is not available for static SQL statements. For query IDs returned from InitializeStaticQuery(), GetQueryText() returns an empty string.

Return Value

If successful, a string containing the SQL text is returned. If unsuccessful, NULL is returned. If the return value is NULL, you can call GetLastErrorString() or GetLastErrorType() to get additional error information.