This discussion is archived
0 Replies Latest reply: Feb 28, 2013 6:46 AM by 988852 RSS

Error running a procedure in Python: (wrong number or types of arguments)

988852 Newbie
Currently Being Moderated
I am getting the following error when trying o execute a stored procedure in python.

cx_Oracle.DatabaseError: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'LOAD_FILE1'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

When executed from the SQL Plus or sql developer the same procedure runs without any issue. The following is the code of the called procedure:

create or replace
PROCEDURE load_file1 (
P_FILE_NAME in varchar2)* IS
src_file BFILE;
dst_file BLOB;
lgh_file BINARY_INTEGER;
BEGIN
src_file := bfilename('inbox_scnr_dir', P_FILE_NAME);
-- insert a NULL record to lock
.........................................................

the above procedure updates creates and updates a record in the table.

I am calling the above procedure as follows in my python code , see the curs.callproc("load_file1",osfile)

for filename in files:
osfile = doc_number(filename)
curs.callproc("load_file1",osfile)+
db.commit()

As you can see I am giving only one argument and the type is string as well, it passes the filename like 'abx.txt' to the procedure. So I am not wrong there.

Am I calling it in a wrong way or the cx_Oracle have some limitation about procedure callings.

Can the gurus on the forum help me please. Just need a direction to resolve this , if you can guide me.

Thanks

Edited by: user10903866 on Feb 28, 2013 5:54 AM

Edited by: user10903866 on Feb 28, 2013 6:45 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points