My Products
Help
AndreasDevDotNet
CONTRIBUTOR ***

Error: SQL command no. 3010 failed.Database error

by AndreasDevDotNet

Getting the above error when running the following query:

 

query
{
    useCompany(no: 4816282)
    {
        queryResult : order
        (
            filter: {_and :[{orderNo :{_gt:100}},{customerNo :{_gt:0}}]},
            groupBy: [{customerNo : DEFAULT},{orderDate : DEFAULT},],
            having: {_or :[{_and :[{_sum : {orderSumNetDomestic :{_gt:100000}}},{_sum : {orderSumNetDomestic :{_lt:200000}}}]},{_count : {orderNo :{_gt:100}}},{_sum : {orderSumNetInCurrency :{_gt:30000}}}]}
        )
        {
            totalCount
            pageInfo
            {
                hasNextPage
                hasPreviousPage
                startCursor
                endCursor
            }
            items
            {
                customerNo
                orderDate
                aggregates
                {
                    sum
                    {
                        orderSumNetDomestic
                    }
                    count
                    {
                        orderNo
                    }
                }
            }
        }
    }  
}

 

 

The response :

 

{
    "errors": [
        {
            "message": "Error: SQL command no. 3010 failed.Database error.",
            "extensions": {
                "data": {
                    "status": 2,
                    "status_name": "DatabaseError"
                }
            }
        }
    ],
    "data": {
        "useCompany": {
            "queryResult": {
                "totalCount": 906,
                "pageInfo": {
                    "hasNextPage": false,
                    "hasPreviousPage": false,
                    "startCursor": null,
                    "endCursor": null
                },
                "items": null
            }
        }
    },
    "extensions": {
        "vbnxt-trace-id": "0000000000000000e39a78870186bda1"
    }
}

 

 

This query worked about a week ago so something must have happened ??

5 REPLIES 5
Accepted solution
Arnstein By
VISMA

by Arnstein By

@AndreasDevDotNet This issue was fixed in the deployment yesterday.

AndreasDevDotNet
CONTRIBUTOR ***

by AndreasDevDotNet

Hi, It worked for me also when I added sort order, but it should work without it, so it would be good if you added this as a bug.

Arnstein By
VISMA

@AndreasDevDotNet We have registered a case for this and will look into it.

Arnstein By
VISMA

by Arnstein By

@AndreasDevDotNet I was able to fix it locally by adding sortOrder to your query:

queryResult : order
(
filter: {_and :[{orderNo :{_gt:100}},{customerNo :{_gt:0}}]},
groupBy: [{customerNo : DEFAULT},{orderDate : DEFAULT},],
having: {_or :[{_and :[{_sum : {orderSumNetDomestic :{_gt:100000}}},{_sum : {orderSumNetDomestic :{_lt:200000}}}]},{_count : {orderNo :{_gt:100}}},{_sum : {orderSumNetInCurrency :{_gt:30000}}}]} 

, sortOrder:{orderDate: ASC}
)
{
totalCount
pageInfo
{

 

Please try and let me know if it helps.

Arnstein By
VISMA

by Arnstein By

@AndreasDevDotNet We are able to reproduce this issue. We will look into it and keep you updated.