I have the following stored procedure that has been giving me problems when calling it. The select statement, when executed alone works just fine, so does creating the stored procedure. But when I "call ();" I get the following error:
Lookup Error - MySQL Database Error: Truncated incorrect DOUBLE value: '0g'
This is the stored procedure. Does anyone see what could potentially be causing this error?
DROP PROCEDURE IF EXISTS test.clients_shipments_with_line_weight_refresh_sp;
CREATE PROCEDURE test.`clients_shipments_with_line_weight_refresh_sp`()
BEGIN
DROP TABLE IF EXISTS clients_shipments_with_line_weight;
CREATE TABLE clients_shipments_with_line_weight
AS
(SELECT reg_client_shipments.*,
wow3.meta_value AS cannabis_type,
(wow2.meta_value * wp_wowcomm_order_itemmeta.meta_value)
AS total_line_item_weight,
pm3.meta_value AS province
FROM clients_shipments
INNER JOIN wp_postmeta pm2
ON clients_shipments.ID = pm2.post_id
INNER JOIN wp_postmeta pm3
ON clients_shipments.ID = pm3.post_id
AND pm3.meta_key = 'statedeliver'
INNER JOIN wp_wowcomm_order_items
ON wp_wowcomm_order_items.order_id =
clients_shipments.ID
AND wp_wowcomm_order_items.order_item_type =
'product'
INNER JOIN wp_wowcomm_order_itemmeta
ON wp_wowcomm_order_items.order_item_id =
wp_wowcomm_order_itemmeta.order_item_id
AND wp_wowcomm_order_itemmeta.meta_key = 'weight'
INNER JOIN wp_wowcomm_order_itemmeta wow2
ON wp_wowcomm_order_items.order_item_id =
wow2.order_item_id
AND wow2.meta_key = 'amount'
INNER JOIN wp_wowcomm_order_itemmeta wow3
ON wp_wowcomm_order_items.order_item_id =
wow3.order_item_id
AND wow3.meta_key = 'producttype'
GROUP BY wp_wowcomm_order_itemmeta.meta_id);
END;