Error Message: 'Query Filter Cannot Be Specified on a Query that Are Split into Multiple Queries Dues to 1:n Fetch Model'
    • 11 Nov 2024
    • 2 Minutes to read
    • Contributors
    • PDF

    Error Message: 'Query Filter Cannot Be Specified on a Query that Are Split into Multiple Queries Dues to 1:n Fetch Model'

    • PDF

    Article summary

    When running a report, users will sometimes get the following error message:

    Error

    Query filter cannot be specified on a query that are split into multiple queries dues to 1:n fetch mode.

    This error message is also shown in Lasernet Connector 6 when configuring the Query. (Within the Query wizard > Dialog setup > Default ranges in the Form Links).

    It is similar to the following error message:

    Error

    1:N Fetch Mode is not allowed on Datasource having join condition with node other than its immediate parent.

    The error occurs when adding a Filter in the Query wizard, Dialog setup and/or the Default ranges. The issue only exists if the Query contains two or more data source structures having at least one of the Fetch Mode/Fetch set to 1:N (One2Many).

    The following is an example containing two data-source-structures:

    A. Containing the data sources/tables CustTable and SalesTable

    B. Containing the data sources/tables CustTable, DlvTerm, and LanguageTxt

    Data source structure A:

    Data source structure B:

    Adding a Filter in Lasernet FO Connector 6 would display the following error message:

    Error

    Query filter cannot be specified on a query that is split into multiple queries dues to 1:n fetch mode.

    A similar error is shown in Lasernet FO Connector 5 when running the report.

    Solution

    There are three ways to resolve the issue, as follows:

    Change the Query Structure

    Restructure the Query - it should be possible to have all the required data sources within the same data source structure as follows:

    Having all data sources in the same structure would not cause the error when using 1:N in the Fetch Mode/Mode.

    This approach also avoids the issue in relation to the row size when having a lot of data sources/tables (issue caused by 1:1).

    Change 1:N to 1:1

    Change 1:N to 1:1 in the Fetch Mode/Fetch, but this could cause the following error if many tables are joined together:

    Error

    [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot create a row of size 8061 which is greater than the allowable maximum row size of 8060.

    This error is only displayed if the query contains a lot of data sources/tables and why Fetch Mode/Fetch 1:1 works in most cases.

    Add a Range instead of a Filter (Lasernet FO Connector 6)

    Lasernet FO Connector 6 contains the option to add a Range instead of Filter by clearing the Filter checkbox in the Ranges in the Dialog setup, Ranges in the Form links, and/or in the ranges in the Query wizard.

    Clearing the Filter checkbox will fix the issue and make it possible to have multiple Query structures with 1:N in the Fetch Mode/Fetch.


    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.