Using the SELECT Statement inside PL/SQL:
As discussed previous, PL/SQL permits embedding of one or more SQL statements inside the block. To show a condition based record the select statement needs an 'INTO' clause. A SELECT statement must contain an INTO clause where the output of the query is assigned to the variable provided in the INTO Clause. The subsequent example described this:
Example
DECLARE
s NUMBER;
BEGIN
SELECT sal INTO s FROM emp WHERE empno=7369; DBMS_OUTPUT.PUT_LINE ('the salary is '||s);
END;
The s variable is assigned the salary of the employee number 7369 and the result would be displayed.