Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
381095280 opened this issue Mar 20, 2025 · 0 comments
Assignees

Comments

@381095280
Copy link

Contact Information

No response

MaxKB Version

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

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

@shaohuzhang1 shaohuzhang1 changed the title [Bug] PYTHON函数库执行SQLSERVER的存储过程时,有插入临时表数据时报错 [Bug] When the PYTHON function library executes the SQLSERVER stored procedure, an error occurred when inserting temporary table data. Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants