Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Hi , I want to pass a cursor to a Oracle store procedure as IN parameter from python3.

User_ZQBPGDec 13 2022

Hi ,
I want to pass a cursor to a procedure as IN parameter from python3.
Input parameter to store procedure is list of dictionaries, which each element is dictionary, where keys have same names as the field names in my Oracle table 'LIMIT_PARAMS'.
I would like to insert the lines to the table, where each line will be per list element.
python code:
l_cur = cur.var(cx_Oracle.CURSOR)
l_cur = LIMFileList
cur.callproc('createNewLIMIT', [l_cur])
PL SQL procedure:
PROCEDURE createNewLIMIT
(
param_data in SYS_REFCURSOR
)
IS
rc LIMIT_PARAMS%ROWTYPE;

BEGIN
loop
fetch param_data into rc;
INSERT INTO LIMIT_PARAMS (PARAM_NAME, KEY, PARAM_MODULE)
values( rc.PARAM_NAME, rc.KEY, rc.PARAM_MODULE);

The python code error is :"element 0 value of type list is not supported"

Comments
Post Details
Added on Dec 13 2022
3 comments
1,999 views