diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2017-08-10 22:21:11 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2017-08-10 22:30:28 +0200 |
| commit | fe51017efdc3f26c94c83fe5930b14d71e1bb380 (patch) | |
| tree | bd60d69b85aa2f207bf992b2dc0a3b546d57bd1b | |
| parent | 7e7edba64bb432dfec36123e03a38074e5fb6fb1 (diff) | |
[1.11.x] Fixed #23766 -- Doc'd CursorWrapper.callproc().
Thanks Tim Graham for the review.
Backport of 660d50805b6788d592b4f1fae706b725baf0195c from master
| -rw-r--r-- | docs/topics/db/sql.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/topics/db/sql.txt b/docs/topics/db/sql.txt index b5c45844cd..94e08b8bef 100644 --- a/docs/topics/db/sql.txt +++ b/docs/topics/db/sql.txt @@ -346,3 +346,29 @@ is equivalent to:: c.execute(...) finally: c.close() + +Calling stored procedures +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. method:: CursorWrapper.callproc(procname, params=None) + + Calls a database stored procedure with the given name and optional sequence + of input parameters. + + For example, given this stored procedure in an Oracle database: + + .. code-block:: sql + + CREATE PROCEDURE "TEST_PROCEDURE"(v_i INTEGER, v_text NVARCHAR2(10)) AS + p_i INTEGER; + p_text NVARCHAR2(10); + BEGIN + p_i := v_i; + p_text := v_text; + ... + END; + + This will call it:: + + with connection.cursor() as cursor: + cursor.callproc('test_procedure', [1, 'test']) |
