{"id":21038554,"url":"https://github.com/devonwintz/oracle-apex-resources-collection","last_synced_at":"2026-02-20T01:02:14.845Z","repository":{"id":124577602,"uuid":"419126689","full_name":"devonwintz/Oracle-APEX-Resources-Collection","owner":"devonwintz","description":"Useful Oracle APEX Resources.","archived":false,"fork":false,"pushed_at":"2021-10-21T12:33:52.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T10:35:28.256Z","etag":null,"topics":["cronscheduler","oracle-apex","oracle-database"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devonwintz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-19T23:56:57.000Z","updated_at":"2021-10-21T12:33:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"64db630f-b719-4130-a94d-74bb958f87bd","html_url":"https://github.com/devonwintz/Oracle-APEX-Resources-Collection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devonwintz/Oracle-APEX-Resources-Collection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonwintz%2FOracle-APEX-Resources-Collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonwintz%2FOracle-APEX-Resources-Collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonwintz%2FOracle-APEX-Resources-Collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonwintz%2FOracle-APEX-Resources-Collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devonwintz","download_url":"https://codeload.github.com/devonwintz/Oracle-APEX-Resources-Collection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonwintz%2FOracle-APEX-Resources-Collection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29637918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cronscheduler","oracle-apex","oracle-database"],"created_at":"2024-11-19T13:33:08.744Z","updated_at":"2026-02-20T01:02:14.821Z","avatar_url":"https://github.com/devonwintz.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oracle APEX Resource Collection\n\nThis repository contains useful Oracle APEX Resources. If you want to add something new, feel free to fork this repo and send me a pull request.\n\n## Table of Contents\n\n[Creating Cron Jobs with DBMS_SCHEDULER](#cron-jobs) \u003cbr/\u003e\n[Creating Cards Using Classic Reports](#classic-report-cards)\n\n## Creating Cron Jobs (Oracle APEX 19.2)\n\nCron jobs can be thought of as scheduled tasks, executed at regular time intervals, defined by the programmer. \u003cbr/\u003e From the aforementioned description, one can see that they need to do two things. These include:\n\n- define a task to be executed;\n- define the intervals. \u003cbr/\u003e\n\nTo accomplish the creating of cron jobs in Oracle APEX, the [DBMS_SCHEDULER](https://docs.oracle.com/database/121/ARPLS/d_sched.htm) can be used. The DBMS_SCHEDULER provides database driven jobs. \u003cbr/\u003e\n\n## Defining a task to be executed\n\nGiven that a cron job is expected to run the same query periodically, a personal recommendation would be to define the task in a [procedure](https://docs.oracle.com/database/apex-18.1/AEUTL/managing-procedures.htm#AEUTL149). Note, the task can also be defined in a PL/SQL Block.\n\n```\nCREATE [OR REPLACE] PROCEDURE procedure_name (param_name param_type, ...)\nIS\n    [declaration_section]\n\n    BEGIN\n        [executable_section]\n\n    [EXCEPTION]\n        [exception_section]\n    END procedure_name;\n```\n\n## \u003ca id=\"cron-jobs\"\u003eCreating Cron Jobs with `DBMS_SCHEDULER`\u003c/a\u003e\n\n```\nBEGIN\n    DBMS_SCHEDULER.CREATE_JOB(\n        job_name        =\u003e 'job_name',\n        job_type        =\u003e 'STORED_PROCEDURE, PLSQL_BLOCK, EXECUTABLE',\n        job_action      =\u003e 'procedure_name OR include PLSQL block',\n        start_date      =\u003e SYSDATE.\n        end_date        =\u003e SYSDATE,\n        repeat_interval =\u003e,\n        enabled         =\u003e TRUE OR FALSE,\n        comments        =\u003e 'job_comments'\n    );\nEND;\n\n```\n\n### Viewing, Enabling/Disabling Schedules\n\nThe `ENABLE` method/function is used in the event that the 'enabled' property was set to `FALSE` when the schedule was created or if the `DISABLE` method/function was previously ran.\n\n```\n//VIEW ALL RUNNING SCHEDULES\n\nSELECT job_name, job_action, start_date, end_date, repeat_interval, enabled, comments FROM SYS.ALL_SCHEDULER_JOBS\n\n//ENABLE/DISABLE SCHEDULE\n\nEXEC DBMS_SCHEDULER.ENABLE('job_name');\nEXEC DBMS_SCHEDULER.DISABLE('job_name');\n```\n\n## Example\n\nIn the code snippet below, a procedure is first created and given the name `update_appointment_status`. After that is created, a scheduler job is created that executes the created procedure, every fifteen minutes.\n\n```\nCREATE OR REPLACE PROCEDURE update_appointment_status IS\n    CURSOR c_appointments IS\n    SELECT ID FROM appointments;\n\n    BEGIN\n    FOR appointment IN c_appointments LOOP\n        UPDATE APPOINTMENTS\n            SET STATUS = CASE\n                WHEN\n                    (\n                        (SELECT TO_CHAR(SYSDATE - 4/24,'MM/DD/YYYY HH24:MI:SS') FROM DUAL) \u003e TO_CHAR(END_TIME, 'MM/DD/YYYY HH24:MI:SS') AND\n                        STATUS = 'Confirmed'\n                    )\n                    THEN 'Completed'\n                    ELSE 'Cancelled'\n                END\n        WHERE ID=appointment.ID AND STATUS != 'Completed';\n    END LOOP;\n    END update_appointment_status;\n\n\nBEGIN\n    DBMS_SCHEDULER.CREATE_JOB(\n        job_name        =\u003e 'update_appointment_status',\n        job_type        =\u003e 'STORED_PROCEDURE',\n        job_action      =\u003e 'UPDATE_APPOINTMENT_STATUS',\n        start_date      =\u003e TO_DATE(TO_CHAR(SYSTIMESTAMP - 4/24, 'MM/DD/YYYY HH24:MI:SS') , 'MM/DD/YYYY HH24:MI:SS'),\n        end_date        =\u003e NULL,\n        repeat_interval =\u003e 'FREQ=MINUTELY; INTERVAL=15',\n        enabled         =\u003e TRUE,\n        auto_drop       =\u003e FALSE,\n        comments        =\u003e 'This scheduled job automatically cancels expired appointments'\n    );\nEND;\n\nEXEC DBMS_SCHEDULER.DISABLE('update_appointment_status');\n\n```\n\n## \u003ca id=\"classic-report-cards\"\u003eCreating Cards Using Classic Reports\u003c/a\u003e\n\n- **CREATE**-is used when you are creating a new trigger\n- **OR REPLACE**-is optional, and is used when you want oto modify an existing trigger\n- **BEFORE|AFTER**-is used to specify when the trigger should be fired.\n- **FOLLOWS**-is used when you have multiple triggers on the same table and you want to specify the order in which they will be fired.\n- **[DISABLE/ENABLE]**-is used to set the status.\n\n\u003cbr/\u003e\u003cbr/\u003e\n\n# Creating Cards Using Classic Reports\n\n- Step 1: Add a region/subregion, with _Type_ **Classic Report**\n- Step 2: Include the following Aliases: _CARD_TITLE, CARD_SUBTEXT, CARD_TEXT, CARD_LINK_.\n- Step 3: Select _Attributes_ and set _Template_ to **Cards**.\n- Step 4: Select _Template Options_ and set _Style_ to **Block**, _Layout_ to **Span Horizontally**, _Animation_ to **Raise Card**.\n\n\u003cbr/\u003e\n\n- **CARD_TITLE** is the main title that is displayed at the first at the top of the card after the icon region.\n- **CARD_SUBTEXT** comes immediately after the title.\n- **CARD_TEXT** comes immediately after the subtext.\n- **CARD_LINK** this is not visible. It is used to link a card to another resource upon a user event.\n\nThe SQL Query should look like the following:\n\n```\nSELECT\n       'Total Goods' AS CARD_TITLE,\n       '' AS CARD_SUBTEXT,\n       COUNT(*) AS CARD_TEXT,\n       NULL AS CARD_LINK\nFROM GOODS\n```\n\nThe code snippet above defines the card title as `Total Goods`. While the subtext is left blank, since there is no need for that. Following the subtext is the body of the card, the _card text_. The total `count` is used here. Lastly, no link was included because the card was not meant to redirect the user to some other resources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevonwintz%2Foracle-apex-resources-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevonwintz%2Foracle-apex-resources-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevonwintz%2Foracle-apex-resources-collection/lists"}