Oracle - PL/SQL - Creating Procedure | how to create Procedures In PL/SQL With Examples | PT

Опубликовано: 05 Октябрь 2022
на канале: Parnika Tutorials
744
7

In this video, I have discussed about procedures in PL/SQL with examples.
"Oracle - PL/SQL - Creating Procedure | how to create Procedures In PL/SQL With Examples
#plsqlcreating #plsqlprocedure #plsqlcreatingprocedure #createprocedure #plsqlbasics #plsqlprocedures #plsqlcursor #plsqlfunctions #plsqltriggers #plsqlvssql #oracleplsql #PLSQLtutorialforbeginners #PLSQLtutorialinenglish #plsqlinterview #plsqlinenglish #parnikatutorials #plsql2023 #plsqlfullcourse2023 #plsqlfullcrashcourse2023 #plsqlcrashcourse

#plsqlcourse2023

00:40 - what is procedure
03:19 - out parameter
04:10 - in out parameter
05:24 - creating or replacing the procedure
06:57 - create or replace a procedure
07:10 - create or replace procedure
07:55 - syntax
09:10 - call the procedure
09:52 - to create a table in sql
10:45 - creat a procedure
17:18 - insertt statement"#pl/sql #parnikatutorials #dbms #procedures

e PL/SQL stored procedure or simply a procedure is a PL/SQL block which performs one or more specific tasks. It is just like procedures in other programming languages.

The procedure contains a header and a body.

Header: The header contains the name of the procedure and the parameters or variables passed to the procedure.
Body: The body contains a declaration section, execution section and exception section similar to a general PL/SQL block.

How to pass parameters in procedure:

When you want to create a procedure or function, you have to define parameters .There is three ways to pass parameters in procedure:

IN parameters: The IN parameter can be referenced by the procedure or function. The value of the parameter cannot be overwritten by the procedure or the function.
OUT parameters: The OUT parameter cannot be referenced by the procedure or function, but the value of the parameter can be overwritten by the procedure or function.
INOUT parameters: The INOUT parameter can be referenced by the procedure or function and the value of the parameter can be overwritten by the procedure or function.

Syntax for creating procedure:

CREATE [OR REPLACE] PROCEDURE procedure_name
[ (parameter [,parameter]) ]
IS
[declaration_section]
BEGIN
executable_section
[EXCEPTION
exception_section]
END [procedure_name];

Table creation:

create table user(id number(10) primary key,name varchar2(100));

Now write the procedure code to insert record in user table.

Procedure Code:

create or replace procedure "INSERTUSER"
(id IN NUMBER,
name IN VARCHAR2)
is
begin
insert into user values(id,name);
end;
/

PL/SQL program to call procedure

Let's see the code to call above created procedure.

BEGIN
insertuser(101,'Rahul');
dbms_output.put_line('record inserted successfully');
END;
/

Social media Links:
Instagram:   / parnikatutorials  
Website: http://parnikatutorials.in/
Email id: [email protected]
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id...
Linkedin:   / parnika-tutorials-a8a9831b2  
Pinterest:   / parnikatutorials0892  
Playlists:
Virtual Coffee with Jagadeesh:
   • VIRTUAL COFFEE WITH JAGADEESH  
Digital Logic Design:
   • Digital Logic Design  
Computer Organization and Architecture:
   • ABOUT PARNIKA TUTORIALS  
C Programming:
   • L 1: WHAT IS AN ALGORITHM AND CHARACT...  
Data Structures:
   • L 1: Uncover the Benefits of Linked L...  

Theory of Computation:
   • ABOUT PARNIKA TUTORIALS  

Compiler Design:
   • ABOUT PARNIKA TUTORIALS  
Operating Systems:    • PROCESS STATE DIAGRAM | LONG TERM, SH...  

Databases:    • ABOUT PARNIKA TUTORIALS  

Computer Networks:
   • ABOUT PARNIKA TUTORIALS  
For GATE PYQs and much more explore:
   / parnikatutorials