Store sql procedures

Good morning,

STORE SQL PROCEDURES

I have three tables:
the first table has the file name:

FILE table:
fileid
first name
DATE
OUTCOME

the second table has the name of the detail:

DETAIL table:
IDDETTAGLIO
FIRST NAME
SURNAME
OUTCOME
FILE_FK

the third table has the public name:
PUBLIC table
IDPUBBLICA
FIRST NAME
SURNAME

I want to create a store procedure in the following ways:

the FILE table has a 1 to N relation of the DETAIL table

in practice, once the data have been entered in the detail table, with insert
in the file table there is the column called the result, this column if it is ok, checking that all the records are inserted in the detail table, ie the positive result is the insert in the public table
otherwise in the detail table if the result is negative ie some record has not been inserted into the table this column is ko and does not insert into the public table

In the public table, having the record called the result
all those who were successful posito ie ok does the insert in the PUBLIC table

I hope I explained myself better

How you do it?

Thank you

Please post create bale scripts and insert scripts with sample data, what you've tried so far and the results you would like. I won't try to guess what you want, maybe someone else will but I feel like your wasting our time not posting the complete question with enough information to solve it.

For each file Check whether all records are entered in the detail table If in the detail table the records are all filled up insert into the public table in the public table and detail table, the state name record becomes OK and the file name status record becomes OK If in the detail table some records have a null value or empty field it does not insert into the public table update a new status of the file table is the status becomes KO
diagramma

the tables you see in the diagram
I have to carry out the procedures in plsql

I think I was clear

you must help me to write the plsql code