Insert data into a table in a stored procedure : Insert « Stored Procedure Function « Oracle PL / SQL






Insert data into a table in a stored procedure

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

Table created.

SQL>
SQL>  create or replace procedure insert_into_t( p_parm in number ) is
  2    begin
  3      insert into t values ( p_parm );
  4    end insert_into_t;
  5    /

Procedure created.

SQL>
SQL> EXEC insert_into_t(12);

PL/SQL procedure successfully completed.

SQL>
SQL> select * from t;

         N
----------
        12

SQL>
SQL> drop table t;

Table dropped.

SQL>
SQL>

   
  








Related examples in the same category

1.Use two insert statements in a 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.