0

i want to pass table type in call_proc using python.

But i'm getting error while running.

PLS-00306: wrong number or types of arguments in call to 'REPORT_P'
ORA-06550: line 1, column 7:
PROCEDURE report_p
    (
        OUT_details     OUT SYS_REFCURSOR,
        IN_col      IN col,
        IN_com  IN  VARCHAR2,
        IN_id       IN NUMBER
    )
create or replace TYPE col AS OBJECT
(
    name        VARCHAR2(4000),
    mn        VARCHAR2(4000),
    fil    VARCHAR2(4000)

);

my code

out_val = cur.var(oracledb.CURSOR)
cur.callproc("report_p",(out_val,[],"Radio",21222))
2
  • This appears to be covered in the documentation: Changing Bind Data Types using an Input Type Handler Commented Jan 5, 2023 at 10:12
  • Also, you are not passing a table type. It is an object. Commented Jan 5, 2023 at 10:13

1 Answer 1

3

To pass an object like col you need to create one first. Something like this:

typ = conn.gettype("COL")
obj = typ.newobject()
obj.NAME = "NAME value"
obj.MN = "MN value"
obj.FIL = "FIL value"
ref_cursor = conn.cursor()
cursor.callproc("report_p", [ref_cursor, obj, "Radio", 21222])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.