Python ile bir oracle db arasında saklı bir yordamı çağırmaya çalışıyorum. Benim sahip olduğum problem bir imleç çıkış parametresini geçiyor.Python-Oracle Bir İmleç Çıkış Parametresinde Geçiş
Oracle saklı yordam temelde:
create or replace procedure sp_procedure(
cid int,
rep_date date,
ret out sys_refcursor
) is
begin
open ret for
select
...
end;
veritabanına çağıran piton kodudur:
import cx_Oracle
from datetime import date
connstr='user/[email protected]:2521/XE'
conn = cx_Oracle.connect(connstr)
curs = conn.cursor()
cid = 1
rep_date = date(2011,06,30)
curs.callproc('sp_procedure', (cid, rep_date, curs))
hatadır:
curs.callproc('sp_procedure', (cid, rep_date, curs))
cx_Oracle.DatabaseError: ORA-01036: illegal variable name/number
Ben de denedim Bir sözlüğü anahtar sözcük olarak geçirmeParametreler:
cid = 1
rep_date = date(2011,06,30)
call_params = {'cid': cid, 'rep_date': rep_date, 'ret': curs}
curs.callproc('sp_procedure', (cid, rep_date, curs), call_params)
Aynı hatayı döndürür.
Teşekkürler.
Merhaba Scott, işe callproc() yöntemini başardı . Teşekkürler. – Jama