Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Tuesday 6 March 2018

plsql - Fetch data from a table in oracle sql

   DECLARE
   c_id number;
   c_name  employee.emp_name%type;
   c_addr employee.emp_address%type;
   c_sal  employee.emp_sal%type;
BEGIN
  c_id := &enter_id;
   SELECT emp_name, emp_address, emp_sal INTO c_name, c_addr, c_sal
   FROM employee
   WHERE emp_id = c_id; 
   dbms_output.put_line
   ('Employee ' ||c_name || ' from ' || c_addr || ' earns ' || c_sal);
END;

No comments:

Post a Comment