Use two insert statements in a procedure : Insert « Stored Procedure Function « Oracle PL / SQL






Use two insert statements in a procedure

  
SQL>  create table t(
  2      n number
  3    )
  4    /

Table created.

SQL>
SQL>  create or replace
  2    procedure insert_into_t(
  3      p_parm1 in number,
  4      p_parm2 in number ) is
  5    begin
  6      insert into t values ( p_parm1 );
  7      insert into t values ( p_parm2 );
  8    end insert_into_t;
  9    /

Procedure created.

SQL>
SQL> begin
  2     insert_into_t(1,2);
  3  end;
  4  /

PL/SQL procedure successfully completed.

SQL>
SQL> select * from t;

         N
----------
         1
         2

SQL>
SQL> drop table t;

Table dropped.

SQL>

   
  








Related examples in the same category

1.Insert data into a table in a stored procedure
2.Roll back data inserted in a procedure
3.Use stored procedure to insert value to a table and use select statement to check the result
4.Use a stored procedure to insert data to a table
5.Adjust salary with pl/sql
6.This procedure will insert a new book into the book table.