Suppose I have a table:
create table foo (
col_1 number;
col_2 number;
);
Then I have the following code
declar
For future reference and carrying one from @user272735 answer - the following also works
create table foo (a number, b number);
insert into foo values(1, 10);
insert into foo values(2, 20);
insert into foo values(3, 30);
/
create procedure bar
as
a number;
b number;
begin
a := 2;
select b into bar.b from foo where a = bar.a;
dbms_output.put_line(b);
end;
/