Forum Stats

  • 3,769,582 Users
  • 2,252,983 Discussions


cx_Oracle, version 5.1.2, Oracle DB, and Python 2.6.6 - NUMBER variables and callproc

srbrown1 Member Posts: 1
edited Feb 12, 2015 12:24PM in Python


I have the following stored procedure signature:

CREATE OR REPLACE PROCEDURE insert_task_execution(
    vId OUT task_execution.Id%TYPE,
    vJob_id IN task_execution.job_id%TYPE,
    vInitiated_by IN task_execution.initiated_by%TYPE,

The table definition is:

CREATE TABLE task_execution
   id                INTEGER                NOT NULL,
   task_summary_id   INTEGER                NOT NULL,
   job_id            INTEGER                NOT NULL,
   initiated_by      VARCHAR2(16 CHAR)      NOT NULL,
   CONSTRAINT        pk_task_exe            PRIMARY KEY (id),
   CONSTRAINT        fk_task_exe_summary    FOREIGN KEY (task_summary_id) REFERENCES task_summary(id)

I call cursor.callproc like this:

connection = cx_Oracle.connect(connectionString)
cursor = connection.cursor()
newRecordId = cursor.var(cx_Oracle.NUMBER)
parameters = [newRecordId, 123, initiatedBy, ... ] cursor.callproc('insert_task_execution', parameters)

I get this exception:

cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data type cx_Oracle.NUMBER

Can someone please tell me what I'm doing wrong, and how to fix it?

Many thanks.

This discussion has been closed.