Posts

Uploading Files to OCI Object Storage from Autonomous

Image
I have been doing a little hobby project and I wanted to be able to store files in OCI's Object Storage, by an upload from an APEX application. In the past I have used DBaaS which didn't include DBMS_CLOUD so I was able to leverage the web credentials feature of APEX. But it's been a while, so time for a fresh exploration from the context of Autonomous DB. Part 1: API Exploration As I already mentioned, there is a package DBMS_CLOUD which has the capability to perform the uploads to object storage from the database. So, the first thing we need to do is check if its available in our app schema - you may need to connect to the admin account and grant execute on it to the given schema. Once that's all verified, we need to register our credentials. There are two likely pathways you would take here (there is a third too, but I won't be investigating that). Username and Password Signing keys authentication I will be using method two. If you want to do the same, you can fi

A note on using a numerical sys_guid with JavaScript

Image
  I've been working on some tables that use the built-in function sys_guid(), converted into a number. I've faced this same problem a couple of times now, so thought I'd post this to try and drill it in. The spec in the table looks like this (note the id column). create table emp2 ( id number default on null to_number(sys_guid(), 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'), ename varchar2(255), sal number ); -- populate data with that in the pre-existing emp table insert into emp2 (ename, sal) select ename, sal from emp; Next, I add a classic report to my page, which includes a button to give the employee a raise. My logic will be to submit the page and to leverage the `apex.page.submit` function.   As you can see, the length of the number is quite long. OK, so on a new column I add to my report, I specify the the URL target as. javascript:apex.page.submit({request:"GIVE_RAISE",set:{"P1_ID": #ID# } }); And when I inspect the button target, t

Getting started with Serverless on Oracle Cloud

Image
  Serverless computing is where your cloud provider runs the servers in which your eventual application code runs, dynamically allocating resources. It allow you as the developer can focus on your application code. Functions can be manually triggered, or fire in response to events in the tenancy, such as a compute instance changing state. Installation The platform the supports serverless on Oracle Cloud is The Fn Project . So to get started the first task we need to do is install this in our local machine. The pre-requisites for this software is Docker - as at time of writing, this requires a minimum docker version of 17.10. If you're on Ubuntu you can install from the package docker.io . Alternatively, you can review the installation docs for best steps to install on your platform. Once Docker is installed, to install Fn, you can follow the install instructions as mentioned within their GitHub documentation . For a Linux environment, this is basically a matter of running an insta

Remote coding with Go and the OCI SDK

Image
Overview For our OCI work, we have some developed some tooling using the command line client, and usually development is done on my local machine and then later deployed onto a server housed within OCI, where we leverage instance principal authentication.  There is one problem with this architecture of development. You're not doing a like for like development with creating the tools and where they actually end up running, because locally you have to use a token authentication, whereas the underlying tools end up living on a server that relies on dynamic groups for instance principal authentication.  A better practice would be if you development was done with the same dynamic group applying to where you develop your code. Thankfully, a popular text editor/IDE, VSCode, has some tooling around remote development - so that on our local machine we can set up a SSH host to a server on OCI. OCI Setup Server The first step is to set up the environment where we will do our development that

New PL/SQL Array Enhancements in Oracle Database 20c

Image
I was catching up on some PL/SQL office hours the other day, and one of the topics was A Preview of Oracle Database 20c PL/SQL Enhancements . The parts of this session that I was particularly interested in were: Extended Iterator Constructs Aggregate Qualified Expressions Before we get started, it's worth noting these features are on version 20c of the Oracle Database, which has not yet been released. You can however boot up a preview version of this software from within Oracle Cloud. Environment Set Up To get set up, head over to your Oracle Cloud tenancy, assuming you have one. If you don't have one, you can sign up for a free trial and use this in your trial period. I am assuming you already have a Virtual Cloud Network configured, so I won't be diving into that aspect. Once you are signed into your cloud environment, on the menu navigate to Bare Metal, VM, and Exadata from within the Oracle Database section. From this landing page, click the button Create DB System .

A Universal Theme Adventure: Header Height

Image
This will be the first post in a series of posts covering some aspects of working with universal theme, where I hope to explore some more of Universal Theme and broaden my knowledge in the process. What first? I want to change the height of the header bar. To get started I create a brand new application - accepting any and all defaults. Any changes to a design/theme usually begins with Theme Roller, so first off: Theme Roller The first, and most obvious way is to leverage Theme Roller. Running the application, in the developer toolbar and select Theme Roller off to the right.  Within Theme Roller, there is one section titled Layout. This gives us a number of options, one of which is Header Height:   This gives us a slide with some preset options between 40 and 80 pixels, with increments of 4 pixels. (It's worth a brief mention that this range is defined from the Input Parameter File URLs given by the path: #THEME_IMAGES#less/theme/Vita.less, in the theme settings). As you adjust

Customising APEX built-in validation messages

Image
I was working on an application and when trying to save some data, I was getting these error messages despite the fact I had no validations on my page. And what I wanted to know, how do I change these message contents? APEX does some default checking based on entered data. A prime example of this is a date field. On a brand new application, I created a region and added a page item with the type as "Date Picker". If I enter text into the date input field that is not a date conforming to the date format, I will get the following error: "Date Field does not match format DS."   First of all, DS? What is that? This particular application was created by uploading a spreadsheet, and I did not set that. In fact, my spreadsheet had no date data to begin with. In saying that, a quick search in the globalization attributes, and somehow this application has the date format set to "DS". So first, let us change that - I like to use DD-MON-YYYY. So that fixes the error