I want to take value from one table and throw into another table. I have function where Im doing a bulk collect into a list. A List of beans.
FUNCTION get_things_info ( p_part_id IN NUMBER)
RETURN bean_list
IS
thing_list bean_list;
BEGIN
SELECT thing_bean (id, file_name, file_type, dbms_lob.getlength(thing), auditable)
BULK COLLECT INTO thing_list
FROM part_things
WHERE part_id = p_part_id;
RETURN thing_list;
END get_things_info_by_id;
I want to take that list, iterate over it and put in a deleted table with the same data types. I have a procedure that does an insert based off some java code:
PROCEDURE insert_thing(p_thing_bean IN OUT NOCOPY file_thing_bean, p_user_id IN NUMBER)
IS
BEGIN
INSERT INTO deleted_part_things
(id, part_id, file_name, file_type, thing, editable)
VALUES ( p_thing_bean.id,
p_thing_bean.parent_id,
p_thing_bean.file_name,
p_thing_bean.file_type,
p_thing_bean.attachment,
p_thing_bean.editable);
END insert_thing;
It does not have to use this procedure. I just need to know how to loop over the list I got back from the first function and insert into the deleted_part_thing
table