Home
Videos uploaded by user “Fdo Luis”
Jobs
 
06:06
https://drive.google.com/file/d/0BxYoN5rLDBaRRkhKRTJBOF94Q2M/edit?usp=sharing
Views: 978 Fdo Luis
PL SQL 6   Triggers
 
07:27
https://drive.google.com/file/d/0BxYoN5rLDBaRbFAxVTl6NFoyUzg/edit?usp=sharing Course Objectives Triggers. example 1 INSERT INTO student (student_id, salutation, first_name, last_name, zip, registration_date, created_by, created_date, modified_by, modified_date) VALUES (STUDENT_ID_SEQ.NEXTVAL, 'Mr.', 'Pedro', 'Perez', '00914', SYSDATE, USER, SYSDATE, USER, SYSDATE); --------------------- Example 2 CREATE OR REPLACE TRIGGER student_bi BEFORE INSERT ON student FOR EACH ROW DECLARE v_student_id STUDENT.STUDENT_ID%TYPE; BEGIN SELECT STUDENT_ID_SEQ.NEXTVAL INTO v_student_id FROM dual; :NEW.student_id := v_student_id; :NEW.created_by := USER; :NEW.created_date := SYSDATE; :NEW.modified_by := USER; :NEW.modified_date := SYSDATE; END; ----------------------- Example 3 INSERT INTO student (salutation, first_name, last_name, zip, registration_date) VALUES ('Mr.', 'Pedro', 'Perez', '00914', SYSDATE); ----------------------- Example 4 CREATE OR REPLACE TRIGGER instructor_aud AFTER UPDATE OR DELETE ON INSTRUCTOR DECLARE v_type VARCHAR2(10); BEGIN IF UPDATING THEN v_type := 'UPDATE'; ELSIF DELETING THEN v_type := 'DELETE'; END IF; INSERT INTO statistics VALUES ('INSTRUCTOR', v_type, USER, SYSDATE); END; ---------------------- Example 5 CREATE OR REPLACE TRIGGER instructor_biud BEFORE INSERT OR UPDATE OR DELETE ON INSTRUCTOR DECLARE v_day VARCHAR2(10); BEGIN v_day := RTRIM(TO_CHAR(SYSDATE, 'DAY')); IF v_day LIKE ('S%') THEN RAISE_APPLICATION_ERROR (-20000, 'Pas de modif. les weekends'); END IF; END; --------------------- Example 6 CREATE OR REPLACE TRIGGER student_compound FOR INSERT ON STUDENT COMPOUND TRIGGER v_day VARCHAR2(10); BEFORE STATEMENT IS BEGIN v_day := RTRIM(TO_CHAR(SYSDATE, 'DAY')); IF v_day LIKE ('S%') THEN RAISE_APPLICATION_ERROR (-20000, 'A table cannot be modified during off hours'); END IF; END BEFORE STATEMENT; BEFORE EACH ROW IS BEGIN :NEW.student_id := STUDENT_ID_SEQ.NEXTVAL; :NEW.created_by := USER; :NEW.created_date := SYSDATE; :NEW.modified_by := USER; :NEW.modified_date := SYSDATE; END BEFORE EACH ROW; END student_compound;
Views: 1038 Fdo Luis
PL-SQL 5   Cursors
 
07:17
https://drive.google.com/file/d/0BxYoN5rLDBaRWGRBLWg3RnhXM0E/edit?usp=sharing Course Objectives cursors ---------------------------- Example SET SERVEROUTPUT ON DECLARE vr_zip ZIPCODE%ROWTYPE; BEGIN SELECT * INTO vr_zip FROM zipcode WHERE rownum menor 2; DBMS_OUTPUT.PUT_LINE('City: '||vr_zip.city); DBMS_OUTPUT.PUT_LINE('State: '||vr_zip.state); DBMS_OUTPUT.PUT_LINE('Zip: '||vr_zip.zip); END; ---------------------------- Example SET SERVEROUTPUT ON DECLARE CURSOR c_zip IS SELECT * FROM zipcode; vr_zip c_zip%ROWTYPE; BEGIN OPEN c_zip; LOOP FETCH c_zip INTO vr_zip; EXIT WHEN c_zip%NOTFOUND; DBMS_OUTPUT.PUT_LINE(vr_zip.zip|| ' '||vr_zip.city||' '||vr_zip.state); END LOOP; CLOSE c_zip; END; ---------------------------- Example DECLARE CURSOR c_group_discount IS SELECT DISTINCT s.course_no FROM section s, enrollment e WHERE s.section_id = e.section_id GROUP BY s.course_no, e.section_id, s.section_id HAVING COUNT(*)mayor=8; BEGIN FOR r_group_discount IN c_group_discount LOOP UPDATE course SET cost = cost * .95 WHERE course_no = r_group_discount.course_no; END LOOP; COMMIT; END; ---------------------------- Example DECLARE CURSOR c_grade( i_student_id IN enrollment.student_id%TYPE, i_section_id IN enrollment.section_id%TYPE) IS SELECT final_grade FROM enrollment WHERE student_id = i_student_id AND section_id = i_section_id; CURSOR c_enrollment IS SELECT e.student_id, e.section_id FROM enrollment e, section s WHERE s.course_no = 135 AND e.section_id = s.section_id; BEGIN FOR r_enroll IN c_enrollment LOOP FOR r_grade IN c_grade(r_enroll.student_id, r_enroll.section_id) LOOP UPDATE enrollment SET final_grade = 90 WHERE student_id = r_enroll.student_id AND section_id = r_enroll.section_id; END LOOP; END LOOP; END;
Views: 570 Fdo Luis
PL SQL 7   Stored Procedures
 
22:28
https://drive.google.com/file/d/0BxYoN5rLDBaRUzNMd29PRy1wd0U/edit?usp=sharing Course objective Stores procedures Functions Packages
Views: 2330 Fdo Luis
Instalar Sqlldr
 
03:42
Instalacion componente Sqlldr
Views: 5658 Fdo Luis
Ágiles Medellin-Colombia 2014 - Pruebas automatizadas por Nicolas Paez
 
47:33
La automatización de pruebas es una práctica fundamental para poder hacer entrega continua de valor disminuyendo el time to market. En esta sesión veremos un conjunto de principios fundamentales como así también herramientas para una efectiva implementación de esta práctica.
Views: 197 Fdo Luis
PL/SQL 1 - PL SQL environment and variables.
 
05:20
https://drive.google.com/file/d/0BxYoN5rLDBaRSGlZYnI3eHZjQzA/edit?usp=sharing Course objective SQL - PL / SQL: what's the difference? Environment PL / SQL Benefits of PL / SQL Features PL / SQL PL / SQL and then? Example 1 Declare --Optional /* Variables, constants, cursors*/ Begin --Mandatory /* Statements PL/SQL Clauses PL/SQL*/ null; Exception --Optional /*Actions to be performed when an exception is thrown or when an abnormal termination occurred*/ when others then null; End; --Mandatory ----------------------------------- Example 2 set serveroutput on ; BEGIN dbms_output.put_line('Hello World') ; END ; ------------------------------------------------ Example 3 SET SERVEROUTPUT ON DECLARE v_pls_value1 PLS_INTEGER := 0; v_pls_value2 PLS_INTEGER := 1; v_simple_value1 SIMPLE_INTEGER := 0; v_simple_value2 SIMPLE_INTEGER := 1; v_start_time NUMBER; v_end_time NUMBER; BEGIN v_start_time := DBMS_UTILITY.GET_TIME; FOR i in 1..50000000 LOOP v_pls_value1 := v_pls_value1 + v_pls_value2; END LOOP; v_end_time := DBMS_UTILITY.GET_TIME; DBMS_OUTPUT.PUT_LINE ('Elapsed time for PLS_INTEGER: '|| (v_end_time - v_start_time)); v_start_time := DBMS_UTILITY.GET_TIME; FOR i in 1..50000000 LOOP v_simple_value1 := v_simple_value1 + v_simple_value2; END LOOP; v_end_time := DBMS_UTILITY.GET_TIME; DBMS_OUTPUT.PUT_LINE ('Elapsed time for SIMPLE_INTEGER: '|| (v_end_time - v_start_time)); END; ------------------------------------------------ Example 4 DECLARE TYPE client_t IS RECORD ( numero_v NUMBER(4), nom_v CHAR(20), adresse_v CHAR(20) ) ; client1_v client_t ; BEGIN client1_v.numero_v := 2516 ; dbms_output.put_line(client1_v.numero_v); END ;
Views: 1652 Fdo Luis
Maria Camila Sanchez Cadavid 15 años de vida
 
13:17
Mis quince años
Views: 132 Fdo Luis
PL SQL 4   Databases and transactional applications
 
08:00
https://drive.google.com/file/d/0BxYoN5rLDBaRTjhOWWZsMjdPejQ/edit?usp=sharing Course Objectives Exceptions create table enrollment (student_id number not null, course varchar2(10)); insert into enrollment values(1,'A1'); insert into enrollment values(2,'A1') insert into enrollment values(1,'B3'); create table instructor (instructor_id number not null, first_name varchar2(20) not null, last_name varchar2(20) not null, course varchar2(10)); insert into instructor values (10,'camille','salinesi','A1'); insert into instructor values (10,'camille','salinesi','B12'); insert into instructor values (15,'Raul','Mazo','A1'); Example 1 DECLARE v_num1 INTEGER := &sv_num1; v_num2 INTEGER := &sv_num2; v_result NUMBER; BEGIN v_result := v_num1 / v_num2; DBMS_OUTPUT.PUT_LINE ('v_result: '||v_result); EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE ('A number cannot be divided by zero.'); END; ----------------------------- Example 2 SET SERVEROUTPUT ON; DECLARE v_num NUMBER := &sv_num; BEGIN DBMS_OUTPUT.PUT_LINE ('Square root of '||v_num||' is '||SQRT(v_num)); EXCEPTION WHEN VALUE_ERROR THEN DBMS_OUTPUT.PUT_LINE ('An error has occurred'); END; ----------------------------- example 3 SET SERVEROUTPUT ON; DECLARE v_num NUMBER := &sv_num; BEGIN IF v_num mayor= 0 THEN DBMS_OUTPUT.PUT_LINE ('Square root of '||v_num ||'is '||SQRT(v_num)); ELSE DBMS_OUTPUT.PUT_LINE ('A number cannot be negative'); END IF; END; ---------------------------- Example 4 DECLARE v_student_name VARCHAR2(50); BEGIN SELECT first_name||' '||last_name INTO v_student_name FROM student WHERE student_id = 101; DBMS_OUTPUT.PUT_LINE ('Student name is '||v_student_name); EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('There is no such student'); END; -------------------------- Example 5 DECLARE v_student_id NUMBER := &sv_student_id; v_enrolled VARCHAR2(3) := 'NO'; BEGIN DBMS_OUTPUT.PUT_LINE ('Check if the student is enrolled'); SELECT 'YES' INTO v_enrolled FROM enrollment WHERE student_id = v_student_id; DBMS_OUTPUT.PUT_LINE ('The student is enrolled into one course'); EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('The student is not enrolled'); WHEN TOO_MANY_ROWS THEN DBMS_OUTPUT.PUT_LINE ('The student is enrolled in too many courses'); END; -------------------------- Example 5 DECLARE v_instructor_id NUMBER := &sv_instructor_id; v_instructor_name VARCHAR2(50); BEGIN SELECT first_name||' '||last_name INTO v_instructor_name FROM instructor WHERE instructor_id = v_instructor_id; DBMS_OUTPUT.PUT_LINE ('Instructor name is '||v_instructor_name); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE ('An error has occurred'); END; -------------------------- Example 6 DECLARE v_student_id student.student_id%type := &sv_student_id; v_total_courses NUMBER; e_invalid_id EXCEPTION; BEGIN IF v_student_id menor 0 THEN RAISE e_invalid_id; ELSE SELECT COUNT(*) INTO v_total_courses FROM enrollment WHERE student_id = v_student_id; DBMS_OUTPUT.PUT_LINE ('The student is registered for '||v_total_courses||' courses'); END IF; DBMS_OUTPUT.PUT_LINE ('No exception has been raised'); EXCEPTION WHEN e_invalid_id THEN DBMS_OUTPUT.PUT_LINE ('An id cannot be negative'); END; ------------------------ Example 7 set serveroutput on DECLARE e_test_exception EXCEPTION; BEGIN DBMS_OUTPUT.PUT_LINE ('Exception has not been raised'); RAISE e_test_exception; DBMS_OUTPUT.PUT_LINE ('Exception has been raised'); EXCEPTION WHEN e_test_exception THEN DBMS_OUTPUT.PUT_LINE ('An error has occurred'); END; ------------------------ Example 8 set serveroutput on; DECLARE v_zip VARCHAR2(5) := '&sv_zip'; v_city VARCHAR2(15); v_state CHAR(2); v_err_code NUMBER; v_err_msg VARCHAR2(200); BEGIN SELECT city, state INTO v_city, v_state FROM zipcode WHERE zip = v_zip; DBMS_OUTPUT.PUT_LINE (v_city||', '||v_state); EXCEPTION WHEN OTHERS THEN v_err_code := SQLCODE; v_err_msg := SUBSTR(SQLERRM, 1, 200); DBMS_OUTPUT.PUT_LINE ('Error code: '||v_err_code); DBMS_OUTPUT.PUT_LINE ('Error message: '||v_err_msg); END;
Views: 235 Fdo Luis
Ágiles Medellin-Colombia 2014 - Carteleras
 
12:56
¿Qué es la Facilitación Gráfica? La facilitación gráfica es la transcripción visual (a través de íconos, ilustración y metáforas visuales) de un proceso grupal. Se usa en espacios tan variados como reuniones, conferencias, retiros, diálogos de grupo, world cafés, etc. El facilitador gráfico hace visible lo que el grupo está discutiendo y se convierte en una herramienta que refleja -de manera inmediata- el proceso por el que están atravesando, y de esta manera ayuda al grupo a tener una visión compartida, sentirse escuchados, monitorear sus avances y llegar a acuerdos. Así mismo, genera elementos gráficos de alto impacto visual, que permiten de manera más efectiva socializar la información. Descarga de imagenes https://drive.google.com/drive/#folders/0BxYoN5rLDBaRQWhoVjR1Z01PaEE/0BxYoN5rLDBaRZlBobENDeENNa3c
Views: 52 Fdo Luis
Maria Camila Sanchez Cadavid - Serenata con Mariachis
 
16:44
Recepcion Abril 12 de 2015
Views: 150 Fdo Luis
PL SQL 3   Databases and transactional applications
 
08:10
https://drive.google.com/file/d/0BxYoN5rLDBaRYnVOanBvUEk1cmM/edit?usp=sharing Course Objectives Bucles Modify data in PL / SQL Transactions and SAVEPOINT in PL / SQL blocks create table student (student_id number primary key, last_name varchar2(50) not null, zip number, registration_date date not null, created_by varchar2(20) not null, created_date date not null, modified_by varchar2(20) not null, modified_date date not null); Create table zipcode (ZIP number primary key, city varchar(20) , CREATED_BY varchar2(20) not null, CREATED_DATE date not null, MODIFIED_BY varchar2(20) not null, MODIFIED_DATE date not null); insert into zipcode values(43224,null,'OPER1',sysdate,'OPER1',sysdate); insert into zipcode values(96864,'PARIS','OPER1',sysdate,'OPER1',sysdate); insert into zipcode values(6325,'BREMEN','OPER1',sysdate,'OPER1',sysdate); BEGIN INSERT INTO student (student_id, last_name, zip, registration_date, created_by, created_date, modified_by, modified_date) VALUES (10, 'Tashi', 10015,'01-JAN-2013', 'STUDENTA', '01-JAN-99','STUDENTA','01-JAN-2013'); END; DECLARE v_zip zipcode.zip%TYPE; v_user zipcode.created_by%TYPE; v_date zipcode.created_date%TYPE; BEGIN SELECT 43438, USER, SYSDATE INTO v_zip, v_user, v_date FROM dual; INSERT INTO zipcode (ZIP, CREATED_BY ,CREATED_DATE, MODIFIED_BY, MODIFIED_DATE) VALUES(v_zip, v_user, v_date, v_user, v_date); END; ------------------------ DECLARE v_max_id number; BEGIN SELECT MAX(student_id) INTO v_max_id FROM student; INSERT into student (student_id, last_name, zip, created_by, created_date, modified_by, modified_date, registration_date) VALUES (v_max_id + 1, 'Rosenzweig', 11238, 'BROSENZ ', '01-JAN-99', 'BROSENZ', '01-JAN-99', '01-JAN-99' ); END; ------------------------ CREATE SEQUENCE test_seq INCREMENT BY 5; DECLARE v_max_id number; BEGIN SELECT test_seq.NEXTVAL INTO v_max_id FROM dual; INSERT into student (student_id, last_name, zip, created_by, created_date, modified_by, modified_date, registration_date) VALUES (v_max_id, 'Rosenzweig', 11238, 'BROSENZ ', '01-JAN-99', 'BROSENZ', '01-JAN-99', '01-JAN-99' ); END; ------------------------ CREATE SEQUENCE student_id_seq START WITH 1 INCREMENT BY 1; BEGIN INSERT INTO student ( student_id, Last_name, zip, registration_date, created_by, created_date, modified_by, modified_date) VALUES ( student_id_seq.nextval, 'Tashi', 10015, '01-JAN-99', 'STUDENTA', '01-JAN-99', 'STUDENTA','01-JAN-2013'); SAVEPOINT A; INSERT INTO student ( student_id, Last_name, zip, registration_date, created_by, created_date, modified_by, modified_date) VALUES (student_id_seq.nextval, 'Sonam', 10015, '01-JAN-99', 'STUDENTB','01-JAN-2013', 'STUDENTB', '01-JAN-99'); SAVEPOINT B; INSERT INTO student ( student_id, Last_name, zip, registration_date, created_by, created_date, modified_by, modified_date) VALUES (student_id_seq.nextval, 'Norbu', 10015, '01-JAN-99', 'STUDENTB', '01-JAN-2013', 'STUDENTB', '01-JAN-99'); SAVEPOINT C; ROLLBACK TO B; END;
Views: 344 Fdo Luis
Ágiles Medellin-Colombia 2014, Conferencia Angel Medinilla
 
40:59
Unicornios, Krakens, Equipos AutoOrganizados y otras bestias mitológicas. Si hay un clarísimo punto común entre Lean y Agile es la necesidad de promover equipos autoorganizados que se hagan responsables del proyecto y de la mejora continua de las organizaciones. Sin embargo, cuando les pedimos a equipos tradicionales que se auto-organicen y sean Ágiles… Todo puede ocurrir, desde la anarquía y el caos hasta intentos bienintencionados de autoorganización que acaban estrellando el proyecto, pasando por equipos que se autoorganizan para hacer Waterfall y equipos que autoorganizan una empresa paralela que le hace competencia a la matriz. A todo esto, ¿qué hacen los gerentes en una empresa de equipos autoorganizados? Y si somos responsables y autoorganizados, ¿para qué queremos un coach o un ScrumMaster? En esta charla revisaremos donde empieza y acaba la autoorganización, las reglas para la autoorganización de los equipos, un modelo de madurez y evolución de equipos Ágiles, cómo delegar progresivamente en el equipo y el papel de los gerentes y los coach Ágiles en un entorno de equipos autoorganizados. Por supuesto, habrá unicornios y krakens también.
Views: 761 Fdo Luis
Videotutorial for downloading and installing SQLDeveloper
 
04:07
Videotutorial for downloading and installing SQLDeveloper. Utilice la opción multi-lenguaje para ver la traducción. Utilisez l'option multi-langue pour voir la traduction.
Views: 13 Fdo Luis
Ágiles Medellin-Colombia
 
41:47
Ágiles Medellin-Colombia
Views: 71 Fdo Luis
Videotutorial for downloading and intalacion OracleXE11g Oracle Database 11g Express Edition.
 
05:04
Videotutorial for downloading and installing Oracle Database 11g Express Edition. Version for Windows x64 is not yet available. Utilice la opción multi-lenguaje para ver la traducción. Utilisez l'option multi-langue pour voir la traduction.
Views: 62 Fdo Luis
Videotutorial pour le téléchargement et intalacion OracleXE11g Oracle Database 11g Express Edition.
 
05:04
Videotutorial pour le téléchargement et l'installation d'Oracle Database 11g Express Edition. Version pour Windows x64 n'est pas encore disponible.
Views: 58 Fdo Luis
instalacion oracle XE 11g
 
05:57
Instalacion base de datos Oracle XE 11g
Views: 15 Fdo Luis
Ágiles Medellin-Colombia 2014 - Mañana empiezo un nuevo proyecto: ¿Qué metodologí­a ágil me pongo?
 
42:40
Uno de los impedimentos más grandes a la hora de implementar Ágil se origina en el desconocimiento que tienen las personas sobre lo que harán a continuación. ¿Por cuál de los métodos empiezo? ¿Uno solo es suficiente? La respuesta corta a esta última pregunta es “no”. Entonces, ¿qué debo saber para dar el salto de aquí hasta ágil? ¿De qué me “agarro” para no caer en el abismo? Estos son los asuntos que abordaré en esta sesión introductoria. Con definiciones simples y ejemplificadas, basado en hechos históricos de los cuales he sido protagonista, le contaré a la audiencia de qué se trata toda esta jerigonza ágil, a manera de Gazafatonario
Views: 43 Fdo Luis
PL SQL 2   Databases and transactional applications
 
06:27
https://drive.google.com/file/d/0BxYoN5rLDBaRMUJuMWs0c1ZrbVU/edit?usp=sharing Course Objectives Variable declaration (again) operators Conversions of data types Nested blocks and variable scope Control Structures Example 1 DECLARE hours_worked INTEGER := 40; employee_count INTEGER := 0; pi CONSTANT REAL := 3.14159; radius REAL := 1; area REAL := (pi * radius**2); BEGIN NULL; END; --------------------------------- Exampl 2 SET SERVEROUTPUT ON DECLARE counter INTEGER; -- initial value is NULL by default BEGIN counter := counter + 1; -- NULL + 1 is still NULL IF counter IS NULL THEN DBMS_OUTPUT.PUT_LINE('counter is NULL'); END IF; END; --------------------------------- Example 3 DECLARE acct_id INTEGER(4) NOT NULL := 9999; a NATURALN := 9999; b POSITIVEN := 9999; c SIMPLE_INTEGER := 9999; BEGIN NULL; END; --------------------------------- Example 4 DECLARE null_string VARCHAR2(80) := TO_CHAR(''); address VARCHAR2(80); zip_code VARCHAR2(80) := SUBSTR(address,25,0); name VARCHAR2(80); valid BOOLEAN := (name != ''); BEGIN DBMS_OUTPUT.PUT_LINE('null_string is'||null_string); IF valid is null THEN DBMS_OUTPUT.PUT_LINE('name is NULL, not ""'); END IF; END; --------------------------------- Example 5 SET SERVEROUTPUT ON DECLARE name VARCHAR(25) NOT NULL := 'Smith'; surname name%TYPE := 'Jones'; BEGIN DBMS_OUTPUT.PUT_LINE('name=' || name); DBMS_OUTPUT.PUT_LINE('surname=' || surname); END; ---------------------------------- Example 6 BEGIN DBMS_OUTPUT.PUT_LINE ('Today is '||'&sv_day'); DBMS_OUTPUT.PUT_LINE ('Tomorrow will be '||'&sv_day'); END; Example 7 ---------------------------------- BEGIN DBMS_OUTPUT.PUT_LINE ('Today is '||'&&sv_day'); DBMS_OUTPUT.PUT_LINE ('The same day is '||'&sv_day'); END; ----------------------------------- Example 8 DECLARE a INTEGER := 2**2*3**2; BEGIN DBMS_OUTPUT.PUT_LINE('a = ' || TO_CHAR(a)); END; ---------------------------------- Example 9 SET SERVEROUTPUT ON -- outer_block DECLARE v_test NUMBER := 123; BEGIN DBMS_OUTPUT.PUT_LINE('Outer Block, v_test: '||v_test); -- inner_block DECLARE v_test NUMBER := 456; BEGIN DBMS_OUTPUT.PUT_LINE('Inner Block, v_test: '||v_test); DBMS_OUTPUT.PUT_LINE('In inner Block, ?outer_block.v_test is: '|| outer_block.v_test); END inner_block; ---------------------------------- Example 10 DECLARE v_num NUMBER := &sv_user_num; BEGIN IF MOD(v_num,2) = 0 THEN DBMS_OUTPUT.PUT_LINE (v_num|| ' is even number'); ELSE DBMS_OUTPUT.PUT_LINE (v_num||' is odd number'); END IF; DBMS_OUTPUT.PUT_LINE ('Done'); END; ---------------------------------- Example 11 SET SERVEROUTPUT ON DECLARE x NUMBER := 5; y NUMBER := NULL; BEGIN IF x != y THEN DBMS_OUTPUT.PUT_LINE('x != y'); ELSIF x = y THEN DBMS_OUTPUT.PUT_LINE('x = y'); ELSE DBMS_OUTPUT.PUT_LINE('impossible to define if = or not'); END IF; END; ---------------------------------- Example 12 SET SERVEROUTPUT ON DECLARE a NUMBER := NULL; b NUMBER := NULL; BEGIN IF a = b THEN DBMS_OUTPUT.PUT_LINE('a = b'); ELSIF a != b THEN DBMS_OUTPUT.PUT_LINE('a != b'); ELSE DBMS_OUTPUT.PUT_LINE('umm, it is not known'); END IF; END; ---------------------------------- Example 13 DECLARE x INTEGER := 2; y INTEGER := 5; high INTEGER; BEGIN IF (x mayor y) THEN high := x; ELSE high := y; END IF; IF NOT (x menor y) THEN high := y; ELSE high := x; END IF; DBMS_OUTPUT.PUT_LINE('high is: '||to_char(high)); END; ---------------------------------- Example 14 DECLARE grade CHAR(1); -- NULL by default appraisal VARCHAR2(20); BEGIN appraisal := CASE grade WHEN NULL THEN 'No grade assigned' WHEN 'A' THEN 'Excellent' WHEN 'B' THEN 'Very Good' WHEN 'C' THEN 'Good' WHEN 'D' THEN 'Fair' WHEN 'F' THEN 'Poor' ELSE 'No such grade' END; DBMS_OUTPUT.PUT_LINE ('Grade '||grade||' is '||appraisal); END; ---------------------------------- Example 15 DECLARE grade CHAR(1); -- NULL by default appraisal VARCHAR2(20); BEGIN appraisal := CASE WHEN grade IS NULL THEN 'No grade assigned' WHEN grade = 'A' THEN 'Excellent' WHEN grade = 'B' THEN 'Very Good' WHEN grade = 'C' THEN 'Good' WHEN grade = 'D' THEN 'Fair' WHEN grade = 'F' THEN 'Poor' ELSE 'No such grade' END; DBMS_OUTPUT.PUT_LINE ('Grade ' || grade || ' is ' || appraisal); END;
Views: 210 Fdo Luis