I am facing some issues while executing permissions for routines(user defined functions) in Informix DB.

GRANT execute ON function admin.SORTKEYJ(LVARCHAR(32672), VARCHAR(50) ) TO public;

My user id is informix and my schema is admin

I created a routine admin.sortkeyj with admin as schema, and while executing the grant privilege for the routine, it fails with error "execute privilege denied on procedure".

The same works fine, if the schema name is 'informix'. So it looks like my schema name and user id should be the same.

Please let me know whether the schema name and user id should always be the same for executing routines and anything needs to be done for user defined functions, if the user name and schema are different. Please help me.