PL/SQL tutorial 41: How To Create PL/SQL Stored Procedure Without Parameters in Oracle Database

RebellionRider.com present you the PL/SQL Tutorial 41 on How To Create PL/SQL Stored Procedure Without Parameters in Oracle Database By Manish Sharma

————————————————————————
►►►LINKS◄◄◄
Blog : http://bit.ly/create-procedure-1
Previous Tutorial
► PL/SQL Blocks: https://youtu.be/rbarR4_gaH8
► Introduction To Stored Procedures: https://youtu.be/buaSuEMi4lw
————————————————————————-
►►►Let’s Get Free Uber Cab◄◄◄
Use Referral Code UberRebellionRider and get $20 free for your first ride.

————————————————————————-
►Make sure you SUBSCRIBE and be the 1st one to see my videos!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
►►►Find me on Social Media◄◄◄
Follow What I am up to as it happens on

https://twitter.com/rebellionrider
https://www.facebook.com/imthebhardwaj
http://instagram.com/rebellionrider
https://plus.google.com/+Rebellionrider
http://in.linkedin.com/in/mannbhardwaj/
http://rebellionrider.tumblr.com/
http://www.pinterest.com/rebellionrider/

___Facebook Official Page___
https://www.facebook.com/RebellionRider.official/

You can also Email me at
for E-mail address please check the “About” section

Please please LIKE and SHARE my videos it makes me happy.
Thanks for liking, commenting, sharing and watching more of our videos

This is Manish from RebellionRider.com
♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS

Comments

Stjepan Mudronja says:

–Building Procedure

create or replace procedure pr_first IS
var_first varchar2(30) := ‘This is my first string!’;
begin
dbms_output.put_line (var_first || ‘Hurray!’);
end pr_first;
/

—-Building Trigger

create or replace trigger tr_first
before insert on table_name
for each row
enable
begin
pr_first;
end;
/

–Calling Procedure

Insert into table_name values (‘Batman’);

Thanks Manish !!!

Akshay Kunder says:

A simple example of a procedure called in Trigger.
Using the example which Manish Sir showed us during Trigger lectures.

1) Table Creation

SQL> create table test_proc(val number);
Table created.

SQL> insert into test_proc values(20);
1 row created.

SQL> insert into test_proc values(30);
1 row created.

SQL> commit;
Commit complete.

2) Procedure Creation

SQL> create or replace procedure DML_PROC as
2 v_user varchar2(30);
3 begin
4 select user into v_user from dual;
5
6 if updating then
7 dbms_output.put_line(‘Record updated by ‘||v_user);
8
9 elsif deleting then
10 dbms_output.put_line(‘Record deleted by ‘||v_user);
11
12 elsif inserting then
13 dbms_output.put_line(‘Record inserted by ‘||v_user);
14
15 end if;
16 end;
17 /

Procedure created.

3) Trigger Creation and Calling the procedure in trigger.

SQL> show user
USER is “PRACTICE”
SQL>
SQL> create or replace trigger DML_TRIG
2 before update or insert or delete on test_proc
3 for each row
4 enable
5
6 begin
7 DML_PROC();
8 end;
9 /

Trigger created.

SQL> select * from test_proc;

VAL
———-
20
30

SQL> insert into test_proc values(40);
Record inserted by PRACTICE
1 row created.

SQL> update test_proc set val=50 where val=20;
Record updated by PRACTICE
1 row updated.

SQL> delete from test_proc where val=50;
Record deleted by PRACTICE
1 row deleted.

RUPAK BHATTACHARJEE says:

DECLARE
m NUMBER :=100;
BEGIN
DBMS_OUTPUT.PUT_LINE(‘The Value of Outer m: ‘||m);
DECLARE
n NUMBER :=200;
tol NUMBER;
BEGIN
m:= 500;
tol := m+n;
DBMS_OUTPUT.PUT_LINE(‘The Value of Inner m,n: ‘||m||’ ‘||n);
DBMS_OUTPUT.PUT_LINE(‘The Total of Sum of m and n: ‘||tol);
END;
DBMS_OUTPUT.PUT_LINE(‘The Value of Outer m: ‘||m);
END;

The Value of Outer m: 100
The Value of Inner m,n: 500 200
The Total of Sum of m and n: 700
The Value of Outer m: 500

Sir Please explain why the last m is showing 500 and not 100?

Yanky Kalifornia says:

thanks for your videos, I think you should make example with relational table, your example is so simple and only learn the sintax, make real example with table with data

Kifayat Khan says:

Great tuts , Sir ,,,,,,

Kifayat Ullah,
Pakistan.

hard reset says:

awesome

Schelly Wagoner says:

This was very helpful! I am searching for a way to substitute a new value for every instance of a returned value in a SQL query over which I have no control, and which creates a temporary table using a stored procedure. If you have any direction or links you can share with me, that would be great. Thank you

Free Soul says:

How to write a procedure to insert/delete a record?

Ayoob manker says:

You are great…..thanks

AMAN JAIN says:

I need to write stored procedure for hotel management can u help me with that

bhawna kumari says:

thank you very much now I can execute procedures.It was very important for me to know this .

 Write a comment

*

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!