For Example: We want to retrive value from table employees and show first name and salary of employee whose employee id is 100.
Code:
declare
sal number;
name varchar2(30);
begin
select salary , first_name into sal,name from employees where employee_id=100;
dbms_output.put_line('Salary of Mr. '||name||' is '||sal);
end;
Result:
Salary of Mr. Steven is 24000
In above example sal and name are used as memory variables.
No comments:
Post a Comment