What is the best way to access stored procedures in Django's ORM

前端 未结 7 1153
轻奢々
轻奢々 2020-12-02 08:44

I am designing a fairly complex database, and know that some of my queries will be far outside the scope of Django\'s ORM. Has anyone integrated SP\'s with Django\'s ORM suc

相关标签:
7条回答
  • 2020-12-02 09:38

    There is a good example : https://djangosnippets.org/snippets/118/

    from django.db import connection
    
    
    cursor = connection.cursor()
    ret = cursor.callproc("MY_UTIL.LOG_MESSAGE", (control_in, message_in))# calls PROCEDURE named LOG_MESSAGE which resides in MY_UTIL Package
    cursor.close()
    
    0 讨论(0)
提交回复
热议问题