Menu

Showing posts with label How to call or execute a procedure. Show all posts
Showing posts with label How to call or execute a procedure. Show all posts

How to create and execute procedure in oracle express edition?

We are going to create a simple procedure in Oracle, which will print a statement.

CREATE OR REPLACE PROCEDURE procedureName
IS
BEGIN
  DBMS_OUTPUT.PUT_LINE('You have successfully executed the procedure!');
END;


To execute or call the above created procedure in Oracle Application express use the following statement.
BEGIN
procedureName;
END;

Below is the screenshot:
create and execute procedure in oracle application express edition
Create and execute procedure in oracle application express edition | Screenshot

You can also download the complete exercise with code from Git .

Execute Oracle procedure using Toad

How to execute a procedure written in Oracle using Toad?

Below is the syntax to execute the stored procedure using Toad for Oracle tool.

Syntax: 
var <variable_name> refcursor
BEGIN
rocedure_name('<parameter1>',
'<parameter2>',:<variable_name>);
END;
print <variable_name>
e.g.
var result refcursor
BEGIN
proc_MyProcedure('jorvee',:result);
END;
print result