Skip to main content

Posts

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(
Recent posts

Ikigai for software developers

C Common sense says you need more than a paycheck to be happy, but happy work won't more likely pay your bills. Ikigai is about finding a balance between what you love, what you are good at, what the world needs, and what you can be paid for. You might enjoy the rat race more with more money, but at the end of the day, you will still feel empty. If you don't enjoy what you do, you are missing a lot. If you are happy in your job and you think you can do this for the rest of your life (and not just till retirement, that is the key difference), congrats! You might have found your Ikigai . If not, you need to find a purpose. Image from https://hyperisland.com/en/blog/thought-leadership/feeling-drained-at-work I have a project where I have a free hand. I am very lucky. The client trusts me and I have a week to build something they want, but in a way I think it will best fulfill the goal. I presented my solutions to the client and so far he always loved it. I can sell my p

Pitfalls of full-stack developer, #thuglife

L Let's face it. As an Oracle APEX developer you are a full-stack developer whenever you like it or not. And if you are one, you know what I am talking about. If not, brace yourself. As APEX developer you have to know APEX. But you also have to know SQL and PL/SQL. It is not realistic to build real/complex app without that. If you are into customizing the look and feel (UI and UX) you will have to know HTML5 and CSS (and design, color theory, typography...) and you will have to know a lot about JavaScript. You also have to know the database design (including a data modeller tool), architecture and administration basics (how database works), at least basics about security, possibly also the performance tuning. The more you know, the easier it will be for you to overcome obstacles. Then you can throw in the cloud thingy, which is also a dedicated profession. Let's add DevOps, middleware, real programming languages for things you can't do in database... On top of that y

Leverage AI for DBMS_SCHEDULER intervals

I I have been designing a small app where you can sync data in tables based on some web service calls. I wanted to give the users a flexible and simple option to schedule refresh of selected tables at specific time. So I have created a page where they can create, manage and test schedules. On the main page they have a list of tables and each schedule as a column with checkbox so they can easily change and see when are which tables synced. The issue is with the schedule intervals (the schedule definition). At first I have added the [?] button with a link to the documentation . But I have realized that nobody from the business will be willing to read that and not everyone will be able to actually create the repeat interval string. So I thought, wouldn't it be nice if you just describe the interval in english and don't care about the technical part at all? Screens for better imagination, prompt and response: This is probably the most simple use case for AI you ca

Oracle Database 23ai SQL Associate, 1Z0-171 exam review

I I like my certifications fresh. You can brag that you are one of the first ones who took the exam, you can help to promote and even raise the awareness that the certification exists. And no one can accuse you of cheating. Here is my mini review of the 1z0-171 exam : Most of the questions are pick 2 or 3 from 5 or 6 options. Much harder to do than on OCI foundations exams where you are picking 1 from 4. Half of the questions are easy to understand, easy to answer. One third is much harder and it will make you sweat. The rest would go to the very hard category and I would say that I have faced several questions where I strongly disagreed with the answers (it is when you are suppose to pick 2 from 6, but you know that 3 are possible or they ask for 3 and you know that only 2 are possible). But based on other legacy exams the percentage of these questions is not bad. On one question I have to guess 3 options from 6 based on non existing exhibit image. I really liked the questio

Copy cell value from IG, revisited

H How to copy cell value from Interactive Grid? I wrote about this few years back in this article . Since that I have been warned by several people that it does not work on some occasions. Non editable grid, Redwood theme, read only cell with link... Many issues. Thanks to Matan from Israel and his ChatGPT friend here is a better solution: document.addEventListener('copy', (event) => { const allowed = 'a-GV-cell'; const active_el = document.activeElement; if (active_el.closest(`.${allowed.replace(/\s+/g, '.')}`)) { const selected = window.getSelection().toString() || active_el.innerText; event.clipboardData.setData('text/plain', selected); event.preventDefault(); } }); But we get the whole row (instead of the selected cell) when copy pasting to Outlook (or any rich text editor). So after more testing and tweaking, we came up with this final solution: document.addEventListener('copy', (

New 23ai SQL and DBA certifications

I I am excited to see brand new classic (non cloud) certifications going to be released soon: Oracle Database 23ai SQL Associate: 1Z0-171 [link] , 60 questions, 65% to pass. It looks very similar to current SQL 1z0-071 exam, I wonder what will be 23ai related. Oracle Database 23ai Administration Associate: 1Z0-182 , 60 questions and 65% to pass. We can see a huge difference compared to the previous DBA 1z0-082 exam - the whole SQL section is missing, so all these 60 questions will be DBA related. If you search Oracle MyLearn for "23ai" materials, you will find this: Oracle Database 23ai: SQL Workshop , 19.5 hours Oracle Database 23ai: New Features for Developers , 6 hours Oracle Database 23ai: Administration Workshop , 12.5 hours Oracle Database 23ai: New Features for Administrators , 8.5 hours Happy learning and let me know if you pass one on these.

About the Oracle ACE program

T There is no Oracle User Group in Czech republic. As far as I know, there are just few PR events organized by local Oracle branch few times per year. Last year there was some initiative to organize monthly meetups, but that died quickly. From the rumours I heard several people tried before and failed. I guess there is not enough interest from both sides. Other sad thing is that I don't know a single person in Czech republic who would publish anything for the community. So to be part of the Oracle community, you have to think beyond the borders. Our closest neighbours (Austria, Germany and Poland) have quite large and engaged communities with many events, but I don't know German nor Polish. It might be your case too. Don't be discouraged by that, there are other options. You can become the ODTUG member or a member of any existing Oracle User Group you like. You don't have to live in that country to be a member, but you should know the local language. Joining Spain

APEX Deployment Tool - Automated patching

P Patching is the most significant feature of ADT. You can do a lot of cool things in ADT, but patching is the coolest one. I call this automated patching, because typically I don't have to intervene and I can deploy a patch without any change. The whole idea behind ADT is to focus on your job as a developer and don't worry about mundane tasks like creating patch files manually. ADT has many checks and features to give you confidence on deploying and time to focus on more important or interesting things. ADT does not store anything in database and it does not need any objects in database either. The patch.py script gets all the information from your Git repo (folders, files and config file). To make this work, you must be using Git. Without Git repo you will not be able to generate patch files. This is part of multiple ADT articles: Introduction & workflow Setup connections, config, folder structure Recompile invalid objects Searching APEX and searchin

APEX Blueprint, the 2024 edition

D During my preparation for the amazing APEX Alpe Adria conference in Maribor I have realized that I no longer consider some of my previous recommendations valid, hence there is a time for an update. You can download my presentation at AAA24 review article. Here are the original Blueprint articles published 01/2022: Part 1 about the obvious things + backend and Part 2 focused on APEX . I will repeat some thoughts from these two previous articles and put all things here, so you can refer just to this one new article. I will also add few new thoughts. And it will be longer than usual (around 10 pages actually). Clean code Clean code is a code that can be understood correctly with minimal effort in minimal time. It is not some utopia and you don't have to go to any extremes. In fact you can do just minimal changes in your applications for a huge improvements. How you done things might be obvious to you now, but not the future you, not to mention your colleagues. So if