Ошибка:
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use near 'CREATE
PROCEDURE
`sp_listProducts` (\n SELECT p.product_id\n , p.pr' at line 3")
SQL:
CREATE PROCEDURE `sp_listProducts` ()
SELECT p.product_id
, p.product
, u.unit
, p.unit_quantity
, p.unit_weight
, p.pr_number
, pj.project_code
, sec.sector
, p.supplier
, p.packaging_info
, loc.location AS project_location
, p.comments
, loc.location_id
, p.product_price
, p.price_currency
, p.gik_number
, p.gik_stock_id
, p.gik_supplier_id AS supplier_id
, gik.gik_supplier
, IF(tr.in_stock > 0, tr.in_stock, 0) as in_stock
FROM tbl_product AS p
# get all FK values for display
LEFT JOIN tbl_unit AS u ON p.unit_id = u.unit_id
LEFT JOIN tbl_project AS pj ON p.project_id = pj.project_id
LEFT JOIN tbl_location AS loc ON pj.location_id = loc.location_id
lEFT JOIN tbl_sector AS sec ON p.sector_id = sec.sector_id
LEFT JOIN tbl_gik_supplier AS gik ON p.gik_supplier_id = gik.gik_supplier_id
LEFT JOIN (
SELECT product_id
, SUM(IF(trans_type IN ('in', 'count-gain', 'wb-gain'), trans_quantity, 0)) as inflow
, SUM(IF(trans_type IN ('out', 'count-loss', 'wb-loss'), trans_quantity, 0)) as outflow
, SUM(IF(trans_type IN ('in', 'count-gain', 'wb-gain'), trans_quantity, 0)) - SUM(IF(trans_type IN ('out', 'count-loss', 'wb-loss'), trans_quantity, 0)) as in_stock
FROM tbl_transaction
WHERE deleted=0
GROUP By product_id
) tr
ON p.product_id = tr.product_id
ORDER BY p.product_id ASC;
Я пытался изменить кодировку на UTF-8, но безрезультатно. Я также установил настройки проекта. json "files.encoding": "utf8" в vscode; не работал Как избавиться от читаемых символов "\ n"?