Presentation is loading. Please wait.

Presentation is loading. Please wait.

From last class… PL/SQL –Triggers –Block structure –Anonymous vs. named blocks –Functions and procedures –Using PL/SQL from SQL*Plus.

Similar presentations


Presentation on theme: "From last class… PL/SQL –Triggers –Block structure –Anonymous vs. named blocks –Functions and procedures –Using PL/SQL from SQL*Plus."— Presentation transcript:

1 From last class… PL/SQL –Triggers –Block structure –Anonymous vs. named blocks –Functions and procedures –Using PL/SQL from SQL*Plus

2 Another PL/SQL example… FUNCTION build_name (name_in IN VARCHAR2, sex_in IN VARCHAR2) RETURN VARCHAR2 IS unknown_sex EXCEPTION ; name_out VARCHAR2(100); BEGIN IF sex_in =‘M’ THEN name_out := ‘Mr. ‘ || name_in; ELSIF sex_in =‘F’ THEN name_out := ‘Ms. ‘ || name_in; ELSE RAISE unknown_sex END IF; RETURN name_out; EXCEPTION WHEN unknown_sex THEN DBMS_OUTPUT.PUT_LINE (‘Unable to determine gender of individual!’); END;

3 Packages Structure of Packages –package header vs. package body Advantages of Packages –invalidated objects –hiding details of code –code maintainability

4 Oracle provided packages DBMS_output DBMS_job DBMS_pipe And more… Set serveroutput on size 4000; DBMS_output.put_line (‘text to be displayed’);

5 Oracle Reports Similar to Forms Object Navigator Reports –Basic reports –Parameter forms in reports


Download ppt "From last class… PL/SQL –Triggers –Block structure –Anonymous vs. named blocks –Functions and procedures –Using PL/SQL from SQL*Plus."

Similar presentations


Ads by Google