abcprep.com - your onestop GMAT, GRE, PMP hub
.NET FAQs Unleashed!
 
    



    


How to run a stored procedure in SQL? How to use the Execute command?

In order to run a stored procedure, the Execute command is used. It is also called Exec command. See code example below:

-- Lets create a stored proc named usp_Insert_Employee

SQL> Create or Replace Procedure usp_Insert_Employee
(fname varchar2(20) in, lname varchar2(20) in)
as
begin
Insert into t_Employee Values
(fname, lname);
end;

SQL> Execute usp_Insert_Employee('Tom', 'Hanks')
-- Notice here that we have passed parameters
-- to the stored procedure.

SQL Queries  SQL  Create Table  DDL, Create, Alter, Drop commands  DML, Select, Insert, Update, Delete  Create Database  ACID Rules  Dual Table  NULL  Join, Inner, Outer, Left, Right, Full, Cartesian, Natural, Equi  Table, View and a Synonym?  Execute  Function  Stored Procedure  Syntax Stored Proc  Stored Procedure Vs. Function








Know Your Breath, Know Your Life!!!