Both of these methods can be used in Sqlplus:
EXEC pro_name (parameter 1:);
Call Pro_name (parameter 1:);
Difference:
1. But exec is a sqlplus command and can only be used in sqlplus; call is a SQL command with no restrictions.
2. When the stored procedure has no parameters, exec can directly follow the procedure name (which can be omitted ()), but call must take ().
SQL code
Sql>--Creating a process to insert data
sql> Create or replace procedure Pro1 is
2 Begin--Executive Section
3 INSERT into mytest values (' Zhang San ', ' mm ');
4 End;
5/
Procedure created
sql> exec Pro1;
PL/SQL procedure successfully completed
Sql> call Pro1;
Call Pro1
ORA-06576: Not a valid function or procedure name
Sql> call Pro1 ();
Method called
Summary: When invoking a process, you should develop a habit of using call and taking it with you.
Execute stored procedure in Oracle call and exec differences