Write a program in PL/SQL to FETCH single record and single column from a table

  • pl/sql

Write a program in PL/SQL to FETCH single record and single column from a table.

الأجوبة

DECLARE
  v_emp_name VARCHAR2(50);
  CURSOR emp_cur_name IS
    SELECT first_name
    FROM   employees
    WHERE  employee_id = 105;

BEGIN
  OPEN emp_cur_name;
  FETCH emp_cur_name
  INTO  v_emp_name;
  
  dbms_output.put_line('The name of the employee is:’
  || v_emp_name);
  CLOSE emp_cur_name;
END;
/
Sample Output:
SQL> /
The name of the employee is:David

PL/SQL procedure successfully completed.
هل كان المحتوى مفيد؟

معلومات ذات صلة

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...