SCSM
  • Home
  • About us
  • Contact us
  • Online Admission
Search
  • Home
  • About us
  • Administration
    • Administrator Profile
    • Non-Teaching Staff
  • Admissions
    • Sr. College
      • UG
        • B.A.
        • B.Sc.
        • B.Com.
        • B.B.A.(C.A.)
        • B.Sc.(Computer Science)
      • PG
        • M.Sc.(Chemistry)
        • M.A.(Economics)
        • M.A.(History)
        • Ph.D.(Chemistry)
    • College Prospectus
      • Prospect 2021-22
      • Prospect 2020-21
  • Programme
    • Doctoral
    • Graduate
    • Postgraduate
  • Departments
    • Arts
      • History
      • English
      • Geography
      • Hindi
      • Marathi
      • Economics
      • Political Science
    • Science
      • Chemistry
      • Electronics
      • Physics
      • Botany
      • Mathematics
      • Statistics
      • Zoology
      • Computer Science
    • Commerce
      • Commerce
      • BBA(CA)
  • IQAC
  • NAAC
  • Student Corner
    • E-Content
      • Statistics
        • Dr.Lohgaonkar M.H
      • Political Science
        • Dr.Netake S.R.
      • Geography
        • Dr.Kadam S.M
    • Library
    • Student Development (SDO)
    • NSS
    • E-Learning
    • ELC
    • NCC
    • Sports
    • Girls Hostel
    • Cafeteria
    • Placement Cell
    • Student Competitive Exam
    • Environment MID Term Examination
    • Anti Ragging Committee
    • Internal Complaints Committee
    • Student Grievance Redressal Committee
  • Contact us

PL/SQL

PL/SQL stands for Procedural Language extensions to the Structured Query Language (SQL).PL/SQL is a combination of SQL along with the procedural features of programming languages.

Structure of PL/SQL Block
PL/SQL extends SQL by adding constructs found in procedural languages, resulting in a structural language that is more powerful than SQL. The basic unit in PL/SQL is a block. All PL/SQL programs are made up of blocks, which can be nested within each other.
Typically, each block performs a logical action in the program. A block has the following structure:

DECLARE
    declaration statements;
BEGIN
    executable statements;
EXCEPTIONS
    exception handling statements;
END;

Data Types in PL/SQL

PL/SQL %TYPE Attribute
Oracle PL/SQL provides a special data type called the %TYPE data type. The %TYPE data type allows you to declare a variable that is associated with a column in a database table.
The Oracle PL/SQL %TYPE attribute allow you to declare a constant, variable, or parameter to be of the same data type as previously declared variable, record, nested table, or database column.
To use the PL/SQL %TYPE data type, you first need to declare a variable. You can then use the variable in your PL/SQL code just like any other variable.
The %TYPE attribute can be used with variables, records, nested tables, and database columns.
Syntax:

identifier Table.column_name%TYPE;

Example:
Here is an example of how to declare a variable using the PL/SQL %TYPE attribute:
declare
v_name employee.name%TYPE;
v_depid employee.deptid%TYPE:=31;
begin
select name into v_name from EMPLOYEE 
where deptid=v_depid;
DBMS_OUTPUT.PUT_LINE('v_name: '||v_name);
end;


Assignment No. 2
1.What is PL/SQL?
2.Explain PL/SQL Block.
3.Explain Data Types In PL/SQL.
4.Explain Control Structure in PL/SQL.

Subscribe Weekly Newsletter

Contact Info

  • Shri Chhatrapati Shivaji Mahavidyalaya,Shrigonda,
    Tal. Shrigonda,Dist. Ahmednagar (Maharashtra)
    Pin.- 413701.

  • Telephone02487-222317

  • Mobile+917387668999

  • email [email protected]

Categories

  • Education
  • Uncategorized

©2023 ALL RIGHTS RESERVED SCSM