Execute stored procedure in Oracle call and exec differences

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.