into clause in oracle
into clause in oracle is used to put values or datas into a variable.
eg: Select empname into ename from employee where emp_id=10;
If we declare ename as varchar we can put the value of empname into ename. Usually into clause is used with select statement. INTO clause is used to , do the operations with use of that particular value. In the above case we can use ename for further operations.
DECLARE
cnt number;
BEGIN
select count(1) into cnt from emp;
dbms_output.put_line(cnt);
end;
eg: Select empname into ename from employee where emp_id=10;
If we declare ename as varchar we can put the value of empname into ename. Usually into clause is used with select statement. INTO clause is used to , do the operations with use of that particular value. In the above case we can use ename for further operations.
DECLARE
cnt number;
BEGIN
select count(1) into cnt from emp;
dbms_output.put_line(cnt);
end;
Comments
Post a Comment