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;

Comments

Popular posts from this blog

Introduction To Oracle10g

Insert

Except