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 07.10.19
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?