MaxKB icon indicating copy to clipboard operation
MaxKB copied to clipboard

[Bug] When the PYTHON function library executes the SQLSERVER stored procedure, an error occurred when inserting temporary table data.

Open 381095280 opened this issue 11 months ago • 0 comments

Contact Information

No response

MaxKB Version

v1.10.1-lts (build at 2025-02-13T18:52, commit: 0640d4c6)

Problem Description

ALTER PROCEDURE [dbo].[Ai_MaxKb_Python_StockGet_33_lsb] @PART_NAME VARCHAR ( 200 )='', --产品名称 @WAREHOUSE VARCHAR ( 200 )='', --仓库 @BATCH_NO VARCHAR ( 200 )='', --批次/色号 @USER_CODE VARCHAR ( 200 )='', @MESSAGE VARCHAR ( 500 )='' OUTPUT

AS BEGIN

-- 库存数据 CREATE TABLE #TempResult ( PART_NAME VARCHAR(100), WAREHOUSE VARCHAR(100), SQUARE DECIMAL(18,2), SORT_ORDER INT );

INSERT INTO #TempResult (PART_NAME, WAREHOUSE, SQUARE, SORT_ORDER) SELECT 'A8877AS' AS PART_NAME, '上海' AS WAREHOUSE, 123 AS SQUARE, 1 AS SORT_ORDER;

SELECT * FROM #TempResult; RETURN

END

Steps to Reproduce

只要函数库的PYTHON里,cursor.execute(f"EXEC Ai_MaxKb_Python_StockGet_33_lsb 'ABC'") 调用执行SQLSERVER的存储过程时,存储过程如上图示例,带有临时表且,注意是且插入临时表数据表就会报错

Image

The expected correct result

No response

Related log output


Additional Information

No response

381095280 avatar Mar 20 '25 08:03 381095280