This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE PACKAGE employee_crud AS | |
| PROCEDURE crea_empleado(p_last_name IN employees.last_name%TYPE, p_email IN employees.email%TYPE, p_hire_date IN employees.hire_date%TYPE, p_job_id IN employees.job_id%TYPE, p_salary IN employees.salary%type); | |
| PROCEDURE borra_empleado(p_employee_id IN employees.employee_id%TYPE); | |
| PROCEDURE actualiza_empleado(p_employee_id IN employees.employee_id%TYPE, p_salary IN employees.salary%TYPE, p_email IN employees.email%TYPE, p_department_id IN employees.department_id%TYPE); | |
| PROCEDURE consulta_empleado(p_employee_id IN employees.employee_id%TYPE, p_last_name OUT employees.last_name%TYPE, p_first_name OUT employees.first_name%TYPE, p_email OUT employees.email%TYPE, p_hire_date OUT employees.hire_date%TYPE, p_job_id OUT employees.job_id%TYPE, p_salary OUT employees.salary%TYPE); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE PACKAGE over_pack | |
| IS | |
| PROCEDURE add_dept(p_depto IN departments.department_id%TYPE, p_name IN departments.department_name%TYPE DEFAULT 'unknown', p_loc IN departments.location_id%TYPE DEFAULT 0); | |
| PROCEDURE add_dept(p_name IN departments.department_name%TYPE DEFAULT 'unknown', p_loc IN departments.location_id%TYPE DEFAULT 0); | |
| END over_pack; | |
| / | |
| CREATE OR REPLACE PACKAGE BODY over_pack | |
| IS | |
| PROCEDURE add_dept(p_depto IN departments.department_id%TYPE, p_name IN departments.department_name%TYPE DEFAULT 'unknown', p_loc IN departments.location_id%TYPE DEFAULT 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE PACKAGE meta_model_pck | |
| IS | |
| PROCEDURE create_table(p_schema_name IN VARCHAR2, p_table_name IN VARCHAR2); | |
| PROCEDURE create_table_constraint(p_schema_name IN VARCHAR2, p_table_name IN VARCHAR2, p_constraint_name IN VARCHAR2); | |
| PROCEDURE main; | |
| END meta_model_pck; | |
| / | |
| CREATE OR REPLACE PACKAGE BODY meta_model_pck | |
| IS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- AS SYS | |
| drop directory oraload; | |
| create directory oraload as "D:\oraload\"; | |
| grant execute on oraload to HR; | |
| grant read on directory oraload to hr; | |
| grant write on directory oraload to hr; | |
| -- AS HR | |
| select * from all_directories where directory_name = 'ORALOAD'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @receiver(pre_save) | |
| def ensure_entity_exists(sender, instance, **kwargs): | |
| list_of_models = ('Route', 'Challenge', 'Event', 'Interest', 'Caution',) | |
| if sender.__name__ in list_of_models: | |
| if not instance.pk: | |
| entity = Entity() | |
| entity.save() | |
| instance.entity = entity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [GET] 104.131.188.248:8000/api-v1/user/<pk>/ # Buscar al usuario por el pk | |
| [GET] 104.131.188.248:8000/api-v1/user/ # retorna lista de usuarios | |
| [POST] 104.131.188.248:8000/api-v1/user/ # Crea un usuario | |
| { | |
| 'email': 'pepex@gmail.com', | |
| 'password': 'pepix', | |
| 'gender': 'M', | |
| 'is_private': false | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE TRIGGER employees1_api | |
| BEFORE INSERT OR UPDATE OR DELETE ON employee1 | |
| REFERENCING NEW AS NEW OLD AS OLD | |
| FOR EACH ROW | |
| DECLARE | |
| TYPE_DML varchar2(10); | |
| BEGIN | |
| /****** Business logic ******/ | |
| IF INSERTING or UPDATING THEN | |
| -- Min salary is 3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <form id="file-form" method="POST"> | |
| <input type="file" id="image" name="image" multiple/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create or replace PACKAGE sailors_package | |
| IS | |
| PROCEDURE sailors_reserves_file(p_sid IN VARCHAR2, p_resultado OUT VARCHAR2); | |
| END; | |
| / | |
| create or replace PACKAGE BODY sailors_package | |
| IS | |
| PROCEDURE sailors_reserves_file(p_sid IN VARCHAR2, p_resultado OUT VARCHAR2) | |
| IS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE TRIGGER aud_sailors | |
| AFTER UPDATE ON SAILORS | |
| REFERENCING NEW AS NEW OLD AS OLD | |
| FOR EACH ROW | |
| DECLARE | |
| BEGIN | |
| INSERT INTO AUD_SAILORS | |
| VALUES ( | |
| USER, | |
| SYSDATE, |