I am not familiar with PL/SQL and just can't transform a working raw query into python code.
Here is the raw query:
DECLARE
returntype MY_PKG_1.MY_DATA_TYPE;
BEGIN
SELECT *
BULK COLLECT INTO returntype
FROM TABLE(MY_PKG_2.MY_FUNC(
param_1 => 'some data',
param_2 => 'some more data'
));
END;
It is a valid query that works just fine, I can run it with cursor.execute() with no errors. But how to get the returned rows? I've tried the following:
returntype = connection.gettype('MY_PKG_1.MY_DATA_TYPE')
cursor = connection.cursor()
results = cursor.callfunc('MY_PKG_2.MY_FUNC', returntype, ['some data', 'some more data'])
cursor.commit()
But I get an error "ORA-04043: object MY_PKG_1.MY_DATA_TYPE does not exist".
selectstatement, sansbulk collect, from your Python code? I don't see what the collection type, local variable, and PL/SQL block are accomplishing.