Sunday, February 22, 2026

How Generative AI can save you time programming menial tasks

 To paraphrase the rock band Staind, It's been a while since I blogged.  And since every tech blog these days is talking about AI, I figured I'd join the bandwagon.

If you're a novice to AI, the first thing you always want to do is protect any sensitive data.  Unless, your company has privatized their LLM, never send any PII (Personally Identifiable Information) to a public LLM.

With my Google One membership, I have access to Gemini Pro, so that's the provider I've been using to assist with my coding.   I'm currently using Oracle Database 19c with Oracle APEX 24.2.

Where I started this was when I had to re-write an integration to a REST API.  The payload is in JSON.  As any one can tell you, one of the most time consuming tasks is parsing JSON because every payload is different, it's a standard that everyone uses slightly differently.   So, I took the test payload and told Gemini "For the attached JSON file, write a pl/sql parser.  Assume an Oracle 19c database and ensure that the parser can be used for any data within this JSON structure".  Within seconds, a pl/sql procedure was presented to me, with the following notes


One of the main issues with the JSON payload provided is that each element could potentially have children and each child can have their own children (and repeat forever).. The first iteration didn't handle this, so I had to tweak my prompts slightly to get the exact results I wanted.  

While the initial code would work, it wasn't the most efficient use of parsing.. It used JSON_TABLE, so I simply asked it to use JSON_QUERY


JSON Payloads typically contain much more info than needed, so I was able to prompt Gemini to only give me the data I required.  Once the code was done, I tested and received an error.. So I told Gemini the error, and it corrected it.



Any other errors I received, I sent and it fixed quickly.. clearly it doesn't compile and test :).  I even was able to tell it to re-write code using my system's coding standards and the code was generated instantly.  

THE MOST IMPORTANT THINGs TO REMEMBER WHEN USING AI TO CODE ARE REVIEW AND TEST!! AI can make mistakes, you need to ensure the codes works exactly as you need it to, and ensure it's written to your standards.

Using Gemini to process these files was a major time saver to me, and allowed me to focus on other things.  Learning the correct way to prompt Gemini is key to delivering the desired results.  What could have taken me several hours to write, took under an hour (with testing an error handling).




How Generative AI can save you time programming menial tasks

 To paraphrase the rock band Staind, It's been a while since I blogged.  And since every tech blog these days is talking about AI, I fig...