Version 1

    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