Oracle SQL: Fetch Monday to Friday dates based on current date or inputted date
Barry's IT Development Blog
by
3M ago
 Requirement: Fetch Monday to Friday dates based on current date or inputted date. Solution select to_char(dow,'DAY')||' '||to_char(dow,'DD-MON-YYYY') display_date,dow date_returned from  (select next_day(to_char(sysdate,'DD-MON-YYYY'),'MONDAY')+ (rownum-1) - 7 DOW from dual connect by level <= 5); Replace "sysdate" with any date paremeter.   Acknowledgement Displaying week days for current week - Ask TOM (oracle.com)   ..read more
Visit website
Hiding the close button on a modal dialog page
Barry's IT Development Blog
by
5M ago
 Requirement You want to take away the close button of the modal window. A good reason could be because you want to force the user to press your own close button and so force something to happen. Solution In the modal dialog page, paste this script in the "Execute when Page Loads" section. var button = parent.$('.ui-dialog-titlebar-close'); //get the button button.hide(); //hide the button Result Gone! Acknowledgement Oracle APEX hide the x on the modal dialog - Stack Overflow   ..read more
Visit website
Oracle Apex: Responding (success/failure) to a call to Apex.server.process
Barry's IT Development Blog
by
1y ago
Requirement React to a Javascript call to apex.server.process In my example, at the end I'll call an inline dialogue after processing. Solution Create a Javascript dynamic action. In my example it is initiated with a button. Javascript Code. var $wP; var displayError = function(error) {     console.error("Promise is rejected:", error); }; var call_block1 = function() {     $wP = apex.widget.waitPopup();     return "End of Block 1"; }; var call_block2 = async function() {     return apex.server.process( "MY_CALLBACK", {pageItems: "#P_TEXT_IN"}, {dat ..read more
Visit website
Oracle Apex: Manipulating a large text CKEDITOR static REGION via an interactive report, CLOBs and database processes.
Barry's IT Development Blog
by
1y ago
 Requirement Because we needed to use an older version of CKEDITOR, it was necessary to load the text editor as a region rather than an item. Similar to what has been explained here: https://content.dsp.co.uk/apex/implementing-ckeditor-5-in-apex-19 But now the requirement was to inject text into the editor on demand. That injected text itself was on the database. The text would be selected from a report. The size of the region could easily be over 32k meaning that workarounds were required to overcome current (Apex 21 and below) limitations. I tried several plugins but found them unr ..read more
Visit website
Oracle Apex - Passing values to a modal
Barry's IT Development Blog
by
1y ago
 Problem You have a button which calls a different modal page. Even though you specify the target page item and source value, the modal does not receive the parameter. Solution Create a hidden item to store a URL. Mine is called P5_ATTACHMENT_URL The parameter that I want to pass is P5_MESSAGE_ID. Create a dynamic action on change of the value that you want to pass. (If you have more than one value you will need to repeat these steps) You want to set the value with this code, don't forget NOT to escape special characters otherwise the link will not make sense. Here is my code ..read more
Visit website
Oracle Apex - Populating a rich text editor item from the DB
Barry's IT Development Blog
by
1y ago
 Requirement You want to populate a rich text item from a value (Clob) stored in the DB. Settings defaults and source doesn't do anything, this worked for me. Solution Assume my item is  Add this application process. Mine is called FETCH_SIGNATURE and its processing point is Ajax Callback. Replace the SQL select at the beginning with your table/column/parameter. DECLARE   l_clob        CLOB;   l_file        BLOB;   l_dest_offset PLS_INTEGER := 1;   l_src_offset  PLS_INTEGER := 1;   l_lang_ctx    PLS_INTEG ..read more
Visit website
Oracle Apex Resizing Rich Text Editor
Barry's IT Development Blog
by
1y ago
 Requirement Rich Text Editor should be as large as possible. But even with template attributes set to Stretched, Extra large, it isn't big. Solution Two pieces of code. Assuming your item is called P5_BODY_RICH: 1. Put this code into the JavaScript Initialization Code property of your Rich Text Editor item.  This code will resize the item. Many other configuration options can be set as well, such as toolbars, colours etc. Take a look at this doc Class Config (CKEDITOR.config) - CKEditor 4 API docs function ( configObject ) {     configObject.width    ..read more
Visit website
Oracle SQL: "Decrypt" PL SQL Packages
Barry's IT Development Blog
by
1y ago
 Requirement You've spotted some PL/SQL code that looks encrypted. The code is in an installation script or you have retrieved it using dbms_metadata.get_ddl. Solution This isn't encrypted, merely masked using a technique called wrapping.  This is done to prevent anyone from displaying that text with the static data dictionary views.  You can use tools like Unwrap It!. Paste the entire code, including the create/replace statement into the box. Result I've masked the result obviously. Acknowledgement Encrypt decrypt PL SQL Packages in oracle - Stack Overflow ..read more
Visit website
Oracle Apex: One Method to display an image from a table
Barry's IT Development Blog
by
1y ago
 Requirement You have an image in a table and want to display it on a page. There are a number of options.  1. Creating an Ajax callback application process and using a URL: to fetch it. e.g <img src="f?p=&APP_ID.:0:&APP_SESSION.:APPLICATION_PROCESS=GETIMAGE:::IMAGE_ID:4"> 2. Creating a display image item type with source SQL Blob column. ..or if these don't work and sometimes they don't for no rhyme or reason, here is a method that looks obscure but worked beautifully for me. Method Create a classic report with the following query, mine was on page 9: select '< ..read more
Visit website
Turning a BASE64 encoded blob back into a binary file
Barry's IT Development Blog
by
1y ago
 Problem I had this data in a BLOB column. I knew that it was a spreadsheet but couldn't understand the format stored. Solution Turns out that this is a base64 encoded string. The header is for information purposes, but if you copy the data string, starting "UEsDBBQABgAI...." to this nifty utilty, it displays the spreadsheet perfectly. In other words, from a pure data perspective, all we're interested in is that long string of data. The approach is thus: 1. Create a CLOB from a BLOB. (Yours might already be in CLOB format) 2. Strip out the header, so that our clob just starts with ..read more
Visit website

Follow Barry's IT Development Blog on FeedSpot

Continue with Google
Continue with Apple
OR