Skip to Main Content

Oracle PL/SQL Einzel-Tipp ansehen

Hier sehen Sie unseren PL/SQL-Tipp „Cursor auf Tabellen-Join”.

Cursor auf Tabellen-Join

Tipp 26

  Thema: Cursor
  Datenbank-Version: RDBMS 8.x
  Erstellt am 07.10.19
  Bearbeitet am 09.08.24
DECLARE
   CURSOR cur_emp_dept IS
   SELECT
       e.ename,
       e.sal,
       d.dname,
       d.loc
   FROM
       scott.emp  e,
       scott.dept d
   WHERE
           e.deptno = d.deptno
       AND e.deptno = 10;
BEGIN
   FOR emp_dept_satz IN cur_emp_dept LOOP
       dbms_output.put(' Mitarbeiter: ' || emp_dept_satz.ename);
       dbms_output.put(' Gehalt: ' || emp_dept_satz.sal);
       dbms_output.put(' Abteilung: ' || emp_dept_satz.dname);
       dbms_output.put(' Ort: ' || emp_dept_satz.loc);
       dbms_output.new_line;
   END LOOP;
END;
/

rem ausgabe :
mitarbeiter :clark 
gehalt :2450 
abteilung :accounting 
ort :new york 
mitarbeiter :miller 
gehalt :1300 
abteilung :accounting
ort :new york 
 

Wussten Sie schon, dass wir auch Schulungen zu Oracle PL/SQL anbieten?