Suppose I have a table:
create table foo (
col_1 number;
col_2 number;
);
Then I have the following code
declar
Try this:
declare
col_1 number;
col_2 number;
begin
col_1 := 1;
select foo.col_2 into col_2 from foo where foo.col_1 = col_1;
dbms_output.put_line(col_2);
end;
/
Table name or synonym says that it entity linked to the table. Also you can use procedure name, if you do the procedure name.
for example, if proc name is DO, you can do the following:
select foo.col_2 into DO.col_2 from foo where foo.col_1 = DO.col_1;