allogagan1
Programmer
ENVIRONMENT:
ISSUE:
We are experiencing an error when attempting to run the Update Macola function within WMS - Billing, after doing Pack Shipments.
This error seems to present itself when there is only one or two orders set to be processed (oepckhdr.ord_comp = 'y')
I am wondering 1) anyone else experience this and/or 2) anyone else able to replicate?
----------------------------------------
ERROR DETAILS:
Attempting to perform the Update Macola function from WMS - Billing and receive the following error:
Error in doPostSelections2
Error.# -2147217913
Error converting data type varchar to numeric
wms115-update_macola_proc1 '1','ALL','ALL','ALL','ALL','ALL','ALL','ALL','ALL','ALL'
followed by:
Error.# 3704
Operation is not allowed when the object is closed
and an apparent endless loop of:
Error.# -2147217913
Incorrect syntax near 'wms115_update_macola_proc1'.
finally selecting Cancel provides:
Stop statement encountered
and the application closes.
----------------------------------------
NOTES:
SQL Profiler shows the failure occuring at the third update statement in wms115-update_macola_proc1 :
Prior to this the CREATE TABLE [#OrderList] statement is issued :
ADDRESSING THE ERROR:
Note that ord_no is being created in the temp table as numeric and oepckhdr.ord_no is char(8), and/or lack of any explicit conversion - which seems to be a bug in itself.
----------------------------------------
STEPS TO TEST AND REPLICATE:
/* remove update safegaurds (1 = 2) to actually perform updates */
/* capture records before update */
SELECT * FROM oepckhdr p WHERE p.ord_comp = 'y' AND p.loc = '1'
/* !!! capture these records or send these to a temp table to come back and fix after testing !!! */
/* update records to clear flag */
UPDATE p SET p.ord_comp = '' FROM oepckhdr p WHERE p.ord_comp = 'y' AND p.loc = '1' AND 1 = 2
/* test billing screen - okay */
/* let's get one order in here */
UPDATE p SET p.ord_comp = 'Y' FROM oepckhdr p WHERE p.id IN (SELECT TOP 1 s.id FROM OEPCKHDR s WHERE s.ord_comp = '' AND s.loc = '1') AND 1 = 2
/* test billing screen - error */
/* let's get another order in here */
UPDATE p SET p.ord_comp = 'Y' FROM oepckhdr p WHERE p.id IN (SELECT TOP 1 s.id FROM OEPCKHDR s WHERE s.ord_comp = '' AND s.loc = '1') AND 1 = 2
/* test billing screen - error */
/* let's get another order in here */
UPDATE p SET p.ord_comp = 'Y' FROM oepckhdr p WHERE p.id IN (SELECT TOP 1 s.id FROM OEPCKHDR s WHERE s.ord_comp = '' AND s.loc = '1') AND 1 = 2
/* test billing screen - okay */
/* update ord_comp back to original values */
Macola ES 9.5.300
WMS 9.6.203
----------------------------------------WMS 9.6.203
ISSUE:
We are experiencing an error when attempting to run the Update Macola function within WMS - Billing, after doing Pack Shipments.
This error seems to present itself when there is only one or two orders set to be processed (oepckhdr.ord_comp = 'y')
I am wondering 1) anyone else experience this and/or 2) anyone else able to replicate?
----------------------------------------
ERROR DETAILS:
Attempting to perform the Update Macola function from WMS - Billing and receive the following error:
Error in doPostSelections2
Error.# -2147217913
Error converting data type varchar to numeric
wms115-update_macola_proc1 '1','ALL','ALL','ALL','ALL','ALL','ALL','ALL','ALL','ALL'
followed by:
Error.# 3704
Operation is not allowed when the object is closed
and an apparent endless loop of:
Error.# -2147217913
Incorrect syntax near 'wms115_update_macola_proc1'.
finally selecting Cancel provides:
Stop statement encountered
and the application closes.
----------------------------------------
NOTES:
SQL Profiler shows the failure occuring at the third update statement in wms115-update_macola_proc1 :
update #orderlist set ship_count = b.shipment_count, bill_of_lading = b.first_bol, last_bol = b.last_bol
from #orderlist a,
(SELECT ord_no, count(bill_of_lading) as Shipment_Count, min(bill_of_lading) as first_bol, max(bill_of_lading) as last_bol from
(Select o.ord_no as Ord_no, c.atchd_code as bill_of_lading from #orderlist o, oeshptcl_vw c where o.ord_no = c.ord_no and c.cart_posted = 'C' and c.atchd_type = 'S' group by o.ord_no, c.atchd_code
union
select o.ord_no, t.attached_bol as bill_of_lading from #orderlist o, oeshptcl_vw c, oeshpttl_vw t where o.ord_no = c.ord_no and c.cart_posted = 'C' and c.atchd_type = 'T' and c.atchd_code = t.pallet_no group by o.ord_no, t.attached_bol)
as tmp group by ord_no
) b
where a.ord_no = b.ord_no
from #orderlist a,
(SELECT ord_no, count(bill_of_lading) as Shipment_Count, min(bill_of_lading) as first_bol, max(bill_of_lading) as last_bol from
(Select o.ord_no as Ord_no, c.atchd_code as bill_of_lading from #orderlist o, oeshptcl_vw c where o.ord_no = c.ord_no and c.cart_posted = 'C' and c.atchd_type = 'S' group by o.ord_no, c.atchd_code
union
select o.ord_no, t.attached_bol as bill_of_lading from #orderlist o, oeshptcl_vw c, oeshpttl_vw t where o.ord_no = c.ord_no and c.cart_posted = 'C' and c.atchd_type = 'T' and c.atchd_code = t.pallet_no group by o.ord_no, t.attached_bol)
as tmp group by ord_no
) b
where a.ord_no = b.ord_no
Prior to this the CREATE TABLE [#OrderList] statement is issued :
CREATE TABLE [#OrderList] ( [ord_type] [char] (1) NOT NULL , [ord_no] [numeric](8, 0) NOT NULL , [cus_no] [char] (20) NULL , [cus_name] [char] (40) NULL , [oe_po_no] [char] (25) NULL , [ship_via] [varchar] (3) NOT NULL , [ship_date] [varchar] (8) NOT NULL , [ship_no] [char] (17) NULL , [ship_name] [char] (40) NULL , [mark_no] [char] (17) NULL , [mark_name] [char] (40) NULL , [header_status] [varchar] (4) NOT NULL , [message] [varchar] (60) NULL , [okaytopost] [varchar] (1) NOT NULL , [bill_of_lading] [varchar] (8) NULL , [ship_count] [int] NOT NULL , [last_bol] [varchar] (8) NULL, [release_type] [char] (1) Null ) ON [PRIMARY]
----------------------------------------
ADDRESSING THE ERROR:
Note that ord_no is being created in the temp table as numeric and oepckhdr.ord_no is char(8), and/or lack of any explicit conversion - which seems to be a bug in itself.
----------------------------------------
STEPS TO TEST AND REPLICATE:
/* remove update safegaurds (1 = 2) to actually perform updates */
/* capture records before update */
SELECT * FROM oepckhdr p WHERE p.ord_comp = 'y' AND p.loc = '1'
/* !!! capture these records or send these to a temp table to come back and fix after testing !!! */
/* update records to clear flag */
UPDATE p SET p.ord_comp = '' FROM oepckhdr p WHERE p.ord_comp = 'y' AND p.loc = '1' AND 1 = 2
/* test billing screen - okay */
/* let's get one order in here */
UPDATE p SET p.ord_comp = 'Y' FROM oepckhdr p WHERE p.id IN (SELECT TOP 1 s.id FROM OEPCKHDR s WHERE s.ord_comp = '' AND s.loc = '1') AND 1 = 2
/* test billing screen - error */
/* let's get another order in here */
UPDATE p SET p.ord_comp = 'Y' FROM oepckhdr p WHERE p.id IN (SELECT TOP 1 s.id FROM OEPCKHDR s WHERE s.ord_comp = '' AND s.loc = '1') AND 1 = 2
/* test billing screen - error */
/* let's get another order in here */
UPDATE p SET p.ord_comp = 'Y' FROM oepckhdr p WHERE p.id IN (SELECT TOP 1 s.id FROM OEPCKHDR s WHERE s.ord_comp = '' AND s.loc = '1') AND 1 = 2
/* test billing screen - okay */
/* update ord_comp back to original values */