Precision error when using OPENQUERY and Global Shop Solutions/Actian backend

124 Views Asked by At

I am querying Global Shop Solutions (backend is Actian) and I'm using OPENQUERY to perform an aggregate operation and then pull those records into SQL Server 2019. When I run the code below, I get this error:

Msg 7354, Level 16, State 1, Line 54 The OLE DB provider "MSDASQL" for linked server "GSS" supplied invalid metadata for column "GSS_Total". The precision exceeded the allowable maximum.

When I remove the SUM() line, the error goes away. Not sure what is going on.

The code:

    select 
    
        * 
        
    from 
    
        openquery(GSS, '
                        select 
                        
                            h.purchase_order
                            , l.part
                            , l.record_no
                            , sum(l.qty_received) GSS_Total
                            , max(l.date_last_received) date_last_received
                            
                        from 
                        
                            v_po_header h 
                            inner join v_po_lines l on h.purchase_order = l.purchase_order

                        where

                            l.part like ''??-*''
                            and l.flag_recv_close <> ''Y''
                            and h.flag_recv_closed <> ''Y''
                            and h.type = 0
                            and substring(l.part, 17, 1) = ''''

                        group by

                            h.purchase_order
                            , l.part
                            , l.record_no
                            
                        ') t
0

There are 0 best solutions below