Impromptu Administration Guide  7.5.0
Methods >

GetNextQueryError Method

Syntax

Application.GetNextQueryError

Applies To

Application Object

Description

Returns the next query error in the current macro.

Discussion

The GetNextQueryError method returns a string that contains the number and associated text for an Impromptu query error.

When a query error is detected, it raises the error number 24610: This report cannot be converted to access the database., indicating that some type of query error has occurred. When occurs, use the GetNextQueryError method to return query error numbers along with their descriptions.

Query Errors fall into the following categories:

Error Range

Error Type

100 to 299

Critical errors. These can occur at either compile-time or runtime, depending on the nature of the error.

300 to 499

Warnings. These are ignored unless the UseQueryWarnings property is set to 1.

500 or greater

Critical runtime errors.

The following list describes briefly the errors returned using the GetNextQueryError method:

Error String

Query Error 100: Cannot execute query. Processing requirements exceed the current Client/Server limits.: Cannot execute query. Processing requirements exceed the current Client/Server limits.

Query Error 101: Data item [%1] could not be found.: Data item [%1] could not be found.

Query Error 102: Data item [%1] is invalid because [%2] could not be found.: Data item [%1] is invalid because [%2] could not be found.

Query Error 103: Using the Governor denied Database Column [%1].: Using the Governor denied Database Column [%1].

Query Error 104: This report will result in a 'cross product' query. This User Profile prevents the use of 'cross product' reports.: This report will result in a 'cross product' query. This User Profile prevents the use of 'cross product' reports.

Query Error 105: The query for this report contains an 'outer join'. This User Profile prevents the use of 'outer join' queries.: The query for this report contains an 'outer join'. This User Profile prevents the use of 'outer join' queries.

Query Error 106: This report sorts on the non-indexed columns.: This report sorts on the non-indexed columns.

Query Error 107: This report contains circular [DATASET] references %1.: This report contains circular [DATASET] references: %1.

Query Error 108: This report contains a prompt nested within a sub-report %1.: This report contains a prompt nested within a sub-report: %1.

Query Error 109: This report uses %1 tables. This exceeds the current Governor restriction of %2 tables for a report.: This report uses %1 tables. This exceeds the current Governor restriction of %2 tables for a report.

Query Error 110: Data item [%1] is invalid because it contains additional invalid Data Items.: Data item [%1] is invalid because it contains additional invalid Data Items.

Query Error 111: Invalid SQL query. Use read-only SELECT statements.: Invalid SQL query. Use read-only SELECT statements.

Query Error 112: Prompt uses column %1 of report %2 which doesn't exist.: Prompt uses column %1 of report %2 which doesn't exist.

Query Error 113: Prompt shows column %1 of report %2 which doesn't exist.: Prompt shows column %1 of report %2 which doesn't exist.

Query Error 300: This report is expected to use %1 tables.: This report is expected to use %1 tables.

Query Error 301: This report is expected to return %1 rows.: This report is expected to return %1 rows.

Query Error 302: The expected report preparation time is %1.: The expected report preparation time is %1.

Query Error 303: This report suppresses duplicates.: This report suppresses duplicates.

Query Error 304: This report will result in a 'cross product' query.: This report will result in a 'cross product' query.

Query Error 305: This report sorts on the non-indexed columns.: This report sorts on the non-indexed columns.

Query Error 306: The query for this report contains an 'outer join'.: The query for this report contains an 'outer join'.

Query Error 307: This crosstab report contains a query column (%1) that no longer exists.: This crosstab report contains a query column, %1, that no longer exists.

Query Error 308: This crosstab report contains a bad reference to %2 in a conditional format.: This crosstab report contains a bad reference to %2 in a conditional format.

Query Error 309: This crosstab report contains a bad reference in %1 to %2.: This crosstab report contains a bad reference in %1 to %2.

Query Error 310: This crosstab report contains a bad reference to %2 in the detail filter.: This crosstab report contains a bad reference to %2 in the detail filter.

Query Error 311: This crosstab report contains a bad reference to %2 in the summary filter.: This crosstab report contains a bad reference to %2 in the summary filter.

Query Error 500: This report exceeded the current Governor restriction of %1 report preparation time.: This report exceeded the current Governor Restriction of %1 report preparation time.

Query Error 501: Database Retrieval Limit reached. Governor restrictions specify a retrieval limit of %1 rows for the current User Profile.: Database Retrieval Limit reached. Governor restrictions specify a retrieval limit of %1 rows for the current User Profile.

Query Error 502: Could not open the following [DATASET] report %1.: Could not open the following [DATASET] report: %1.

Return Type

String

Example

This example traps Impromptu query errors in sequence and shows a message for each one that appears.

Sub Main()
  Dim objImpApp As object
  Dim objImpRep As object
  Dim strErr as String
  On Error goto HndlErr
  Set objImpApp = CreateObject("CognosImpromptu.Application")
  objImpApp.visible 1
  objImpApp.UseQueryWarnings 1
  objImpApp.OpenCatalog  _
   "sybase.cat","admin","admin_pwd","qcimprom","qcimprom",1
  Set objImpRep = objImpApp.OpenReport("sybase01.imr")
   HndlErr:
     do
         strErr = objImpApp.GetNextQueryError
      if strErr <> "" then
         MsgBox strErr
      else
         exit do
      end if
   loop
   resume next
   Set objImpRep = Nothing
   Set objImpApp = Nothing
End sub

More information