Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multiple Insert Statements

mterleskyJan 5 2010 — edited Jan 6 2010
Hello,

I have a couple of PL/SQL Anonymous block processes (both On-Submit - After Computations and Validations) on a page that insert a few values into a table.

The first gets the next primary key value from the sequence:
declare 
  function get_pk_tran return varchar2 
  is 
  begin 
    for c1 in (select TRANSACTIONS_SEQ.nextval next_val
               from dual)
    loop
        return c1.next_val;
    end loop;
  end; 
begin 
  :P21_TRAN_ID := get_pk_tran; 
end;
The second inserts the values into the table:
begin
insert into transactions (TRAN_ID,TRAN_TYPE,TRAN_SUB_TYPE,TRAN_VALUE) values (:P21_TRAN_ID,'Status','Submission','Submitted');
end;
I want to insert two more records into the same table upon submission. I could add similar pairs of processes to do this again, but there is probably a more efficient way.

Any suggestions are greatly appreciated!

Thanks
Matt
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2010
Added on Jan 5 2010
2 comments
707 views