How to use grant reference

0

I have 2 schemes in oracle each with their username and password, I have a billing and a payroll of which in the billing scheme I have a table called fct_personas and in payroll I have a table called nomi_employees
I would like to know how to use the grant reference for permissions when inserting values in the tables for example if I have 10 records in the table fct_people, in the scheme nomi_employees should not let me insert an employee with id number 11 while this id 11 does not exist in the table fct_persons this this try but it gives me error

grant references on usr_facturacion.fct_personas to usr_nomina.nomi_empleados
    
asked by Base Oracle 13.11.2017 в 01:01
source

1 answer

0

Connected to user usr_facturacion , you can execute the following statement:

grant references on fct_personas to usr_nomina

As you can see, permission is given to a user, not a table.

Once this grant works for you, you can now connect with the user usr_nomina and define a foreign key constraint that refers to the usr_facturacion.fct_personas table. I do not know the names of your columns, but it would be something like this:

alter table nomi_empleados
add constraint nomi_empleados_fk01
foreign key (id)
references usr_facturacion.fct_personas(id)
    
answered by 13.11.2017 в 04:04