This content has been marked as final. Show 3 replies
I already have a stored procedure in Oracle which gets a blob, is doing something with blob afterward and returns another blob. My python application is reading a file in, calls the oracle procedure (passes on the file to it), receives a blob and writes it to the file system. Reading and writing files from python is not the problem. Problem is how do I transfer it to or from the stored oracle procedure.
create or replace package my_blob_proc (blob_in in blob, blob_out out blob)
< do something with blob_in>
< put something on blob_out>
connection = cx_Oracle.connect('...')
cursor = connection.cursor()
f_blob = open('anyfile','rb')
blob = f_blob.read()
# question is how do I call callproc to have a blob as input and another blob
cursor.callproc('my_blob_proc', what do I have to put here to pass the blobs?)
and continue writing blob_out to file ...
Thanks a lot, Hannes