odoo12调用存储过程(procedure)
-
数据库中有存储过程如下:
CREATE OR REPLACE PROCEDURE "public"."triple"(INOUT "x" int4)
AS $BODY$
BEGIN
x := x * 3;
UPDATE hr_employee set
COMMIT;
END;
$BODY$
LANGUAGE plpgsql在navicat中执行此存储过程:

但是在python代码中使用psycopg2包进行调用的时候,就无法成功。
报错截图如下:


如果在存储过程中将commit注释掉,cursor.execute("CALL triple(3)") 可以执行成功
-
@zhihao-ding 在 odoo12调用存储过程(procedure) 中说:
UPDATE hr_employee set
UPDATE hr_employee set 这行是想测东西加的 执行的时候没有这行 就当这行不存在 em...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login