Question: How to run a function from system?

Question

How to run a function from system?

Answers 1
Added at 2017-01-02 16:01
Tags
Question

So I have a function called doLogin, that receives two arguments, and I created a user called user_login. I have granted user_login the following privileges:

GRANT CREATE SESSION TO user_login;
GRANT EXECUTE ON DoLogin TO user_login;
GRANT SELECT ON Utilizadores TO user_login; --do Login gets information from this table

But when connect using user_login and try to run the function, I receive the following error:

Erro: java.sql.SQLException: ORA-06550: line 1, column 13: PLS-00201: identifier 'DOLOGIN' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored

Edit: I would like that only system and user_login have acess to this function

Answers
nr: #1 dodano: 2017-01-02 17:01

Say you defined your function DoLogin in your schema (say yourSchema) and you need to use it from within a different user, say user_login.

You may decide to call the function with

yourSchema.DoLogin

or create a public synonym, from within yourSchema, and then call the function without adding the schema name:

create public synonym DoLogin for DoLogin
Source Show
◀ Wstecz