I have a table type input+output(IO) variable in oracle(with 5 columns), i read values from it in a loop and and also perform validations, if there's an validation fired i put an error message in fifth column. if the fifth column is null i insert values in table. I have working code for this. But what i need is ,suppose i have 5 rows to be inserted, and if there's a validation fired for any row then data should not be inserted for other rows as well. I cannot raise exception as i still need error message for other rows.
I have 2 solutions for this. First..Perform validations first(without insert), if fifth column is empty then will again run loop and insert in table. Second..Insert values in a temporary table, if no validation fired till last row then will select from temp table and insert in main table.
Is there a better way to handle this?