From: Jürgen M. <Jue...@fl...> - 2008-02-18 18:46:30
|
Hi, I have following problem with calling stored procedures by using function callproc: It is only possible to call a Stored Procedure which has the same database schema than the user from the DB2-connect-string, although the user has the rights for executing the stored procedure I tried to call the stored procedure with 'schema'.'storedProcedure', but that didn't work. It throws exception: _db2.Error: ('42884', -440, '[IBM][CLI Driver][DB2/NT64] SQL0440N No authorized routine named "SCHEMA1.TESTPROC1" of type "PROCEDURE" having compatible arguments was found. SQLSTATE=42884\r\n') Strange is, that it is possible to call a StoredProcedure from a other schema with the function execute and the parameters ('call 'schema'.storedProcedure'). Unfortunately it is only possible to use this function with IN parameters and not with INOUT and OUT parameter. cn=DB2.connect('database','user','password') cs=cn.cursor() params = None # is working (has the same schema than the user from the connect sting) returnValue = cs.callproc('TESTPROC8',params) print returnValue # is also working cs.execute('call SCHEMA1.TESTPROC1(123)') # is not working returnValue = cs.callproc('SCHEMA1.TESTPROC1',123) print returnValue cn.commit() cs.close() cn.close() Thanks for your help, Juergen |