INSERT ALL



oracle dont support sequence number increment in muti table insert. Hence an alternate solution is
to create a fuction and call that in values claues.



insert all

into t1 (col1,id)

values (object_name,fee_billing_pkg.getCurrVal('fee_rule_usage_seq'))

into t1 (col2,id)

values (object_type,fee_billing_pkg.getCurrVal('fee_rule_usage_seq'))

select object_name ,object_type

from user_objects

where rownum < 11



FUNCTION getCurrVal_function ( seq_name VARCHAR2 )



RETURN number IS return_value NUMBER;



BEGIN



EXECUTE IMMEDIATE 'select ' || seq_name || '.nextval from dual'

INTO return_value;

RETURN return_value;



END;

Comments