PL/SQL is a language used in all Oracle products. It is a language which has procedural features known as SQL Statements. The procedural features are variables, control statements, such as IF…THEN, FOR loop, and WHILE loop, subprograms, and exceptions. If you haven’t installed Oracle, go to https://www.youtube.com/watch?v=WTSKqJulspg. You will need to perform the tasks in order to learn the concepts.
We shall discuss about PL/SQL programs, block structured language, and work area cursor. We shall also cover about control statements, modularity, and packages. Furthermore, we learn about the concept of data abstraction and information hiding. We shall also learn about database triggers and advantages of PL/SQL.
Nature of PL/SQL Programs
PL/SQL is used in stored procedures, programs, packages, forms, and reports; and does not have convectional input and output statement (read and write) as other languages. The input is taken mainly from the table, while the output is stored in the table.
Some Sample Programs
- Write a program to add two numbers.
DECLARE X NUMBER := 90; Y NUMBER := 34; Z NUMBER; BEGIN Z:= X+Y; DBMS_OUTPUT.PUT_LINE(Z); END;