1
我想在Django調用存儲過程,但是這表明此消息(1305, 'PROCEDURE storedprocedureservice.MyStoredProcedure does not exist')
Django的 - 存儲過程不存在
這是我的代碼:
class StoredProcedureService():
def close_service(self, param1, param2, param3):
cursor = connection.cursor()
ret = cursor.callproc("StoredProcedureService.MyStoredProcedure", (self, param1, param2, param3))
cursor.close()
return ret
@csrf_exempt
def service(request):
if request.is_ajax:
value = request.POST.get('value')
stored_procedure = StoredProcedureService()
ret = stored_procedure.close_service(value, 1, 'Lorem Ipsum')
return JsonResponse({"status":"ok"})
我的過程是在其他數據庫,我準備配置它,但不知道如何稱呼它。
我嘗試,但沒有工作: cursor = connection.using("myOtherDatabase").cursor()