How do you get output parameters from a stored procedure in Python?

前端 未结 9 1811
既然无缘
既然无缘 2020-12-20 13:40

I\'ve googled around a bit, but maybe I didn\'t put the correct magik incantation into the search box.

Does anyone know how to get output parameters from a stored p

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-20 14:14

    I'm not a python expert but after a brief perusing of the DB-API 2.0 I believe you should use the "callproc" method of the cursor like this:

    cur.callproc('my_stored_proc', (first_param, second_param, an_out_param))
    

    Then you'll have the result in the returned value (of the out param) in the "an_out_param" variable.

提交回复
热议问题