Skip to main content

Posts

Showing posts from October, 2024

How to debug APEX authorization schemes, #JoelKallmanDay

I I was going to write about the brand new and hot Oracle AI feature, the prebuilt OCI Generative AI agent with RAG , which I saw last week at local Oracle event at Prague. You basically get a pretrained AI agent, throw at it your files and it will be answering your questions with knowledge gained from your files. The plan was to spend some time during the weekend and play with it, but both my cloud accounts are at Frankfurt. Despite the claims of the Oracle support, you have to be in Chicago region. It is not available in other regions yet. I don't want to create another free OCI account and on free it is not possible to subscribe to another region. Today is day #5 since I am unsuccessfully upgrading my OCI to paid version (and despite having a ton of credits from the Oracle ACE program). As all of you certainly know, the Oracle support sucks. You don't have to be sad, because Adrian is the expert on this field and he wrote about this amazing feature today and with mu

Bulk expose your package constants to SQL

T Typically you have some constants in packages. And sooner or later you need to use these constants in SQL statements outside of the package, like in a view. Sadly even the latest Oracle 23ai won't help you with this. The solution is to create a function for each constant, which can be very tedious if you have many constants. I have created a generator to automate this , but here is a different approach. We have can utilize the USER_SOURCE view to get the constant value and the USER_IDENTIFIERS view to localize constants in the package. With this approach you can also expose constants from the BODY. Here is the function: CREATE OR REPLACE FUNCTION get_constant ( in_package VARCHAR2, in_name VARCHAR2, in_prefix VARCHAR2 := NULL, in_private CHAR := NULL ) RETURN VARCHAR2 RESULT_CACHE AS out_value VARCHAR2(4000); BEGIN SELECT NULLIF( REGEXP_REPLACE(