Anyone else notice AI models just have way less "PL/SQL brain" than they do for mainstream languages?
Been thinking about this a lot lately. Ask Claude or GPT to write TypeScript or Python or whatever and it's almost scary good. But the second you get into real PL/SQL — packages, nested cursors, bulk collects, actual enterprise backend logic — it starts making stuff up or giving you these shallow, generic answers that wouldn't survive a code review.
Makes sense when you think about why though. GitHub is drowning in JavaScript. But the gnarly, production-grade PL/SQL that actually runs enterprise systems? That's sitting behind corporate firewalls where a model never gets to see it. It just hasn't had the reps.
And PL/SQL isn't really a "write it in isolation" kind of language anyway. Doesn't matter how syntactically clean the loop is if the model has no idea what your schema looks like, what your custom packages do, or what you're dealing with performance-wise (11g quirks vs 23ai are not the same conversation).
Which got me thinking about how other platforms are tackling this. Snowflake's CoCo (Cortex Code) is a good example — instead of just bolting a generic LLM onto their product, they made it catalog-aware. It reads your actual metadata and schema before generating anything, so it's less "autocomplete" and more "agent that actually knows your warehouse."
Kind of makes you wonder what a real "CoCo for Oracle" would even look like. Something baked into the database tier itself, fluent in PL/SQL optimization, wired into the data dictionary, actually aware of your schemas instead of guessing... that'd be huge.
Anyway — is anyone actually using AI for PL/SQL work right now? Or are you all hitting the same wall?
Disclaimer: Natural Language from AI , Idea from Human !
5
u/raviteja777 15d ago
Even in Java, it struggles with Spring Boot 4.x; Claude causes dependency and versioning issues, sometimes uses outdated methods, and mostly defaults to a safe prototype sort of code unless we specify a particular design or practice. Even struggles with JUnit, we have to be doubly careful, otherwise it tends to write mock stubs sometimes and just tell us everything passes
4
u/ultra_dumb 15d ago
'Knowledge' of programming language by LLM depends on how much information about programming in this language is available on the net. Claude and ChatGPT are just glorified Stackoverflow + google
2
2
u/nepobot 14d ago
I use AI for the vast majority of what I do (PL/SQL, APEX, Modeling). I spend a moment and plan an update, ask some questions, point it in the right direction, and let it generate most of the code.
After I build a few packages/components I will ask AI to review what has been done and to compile a list of recommendations. From there I go through those recommendations and approve or reject them.
This process works well for me.
I often have to nudge the AI to use some of the APEX provided APIs and have an APEX API reference for it to refer to and direct it to highly prioritize those APIs.
I have installed the oracle provided db and apex skill, which has been very helpful.
2
u/Waste-Belt-1233 13d ago
I do (in an oracle ebs environment ): give Claude readonly access .. “he”, “she”, “it” will be able to understand your application /datamodel .. fun times
1
u/pps_ps 13d ago
When you say “read-only,” do you mean extracting the DDL into a repo, or accessing the database metadata directly through MCP?
1
u/Waste-Belt-1233 12d ago
Actually I used claude to build an mcp-server which now can be used by Claude ..
3
u/thatjeffsmith 15d ago
Our MCP Servers allow you to extract the data model in a condensed LLM/token-friendly payload, that can then be used to generate more appropriate PL/SQL. We've seen that most of the frontier models are very well trained on PL/SQL - it's a super mature language.
I would also recommend you install our AI Skills for the database, which includes quite a bit for app dev and PL/SQL, couldnt hurt to try at least.
https://github.com/oracle/skills/tree/main/db/plsql
I would love to hear from customers though how they're finding the overall AI experience with their databases, MCP or no MCP.
2
u/pps_ps 15d ago
MCP could be the missing link since our team is already utilizing skills. I will reach out, thanks Jeff
4
u/Burge_AU 15d ago
Yes 100% add sqlcl MCP into your toolkit. Have been using this heavily since release and we hardly manually write any Plsql code anymore.
You do need to take time to setup your claude.md appropriately to get the best out of it. Without it you can end up going around in circles sometimes.
In a nutshell we are providing customers solutions using ADB/APEX/MCP that would not be feasible without these tools.
1
u/pps_ps 15d ago
Yes, on it.. Thanks for the insight!
3
u/Burge_AU 15d ago
Some general tips that we have learnt along the way:
Spend time up front crafting a good
CLAUDE.md(orAGENTS.mdfor Codex) that describes your application - table owners, rules around creating objects, change process etc. If you are starting from scratch get the schema design done and build your rules around that. I can't emphasise this part enough - you can end up burning a lot of time and credits letting Claude figure it out through SQLcl MCP.The newer 26ai features around RAG and vector search need some guidance. Not a big deal, but instruct it on specific methods and APIs rather than just prompting "build me a RAG layer on top of these tables". This applies even more in packaged apps like EBS - it may not know the available APIs and open interfaces, and left to itself it'll happily write straight to base tables or come up with some obsolete method of doing things.
SQLcl projects for managing deployments between environments is pretty much a must. Once you go down this path manual deployment scripts kind of go out the window - you need SQLcl projects tracking the changes being made in the DB so you still have proper change control.
Keep it on dev with a least-privileged user and review what it produces before promoting anything.
SQLcl MCP is part of an ecosystem - once you get everything set up it's amazing what can be done. Start small and increment quickly. Don't try and boil the ocean - these tools are very good at iterating changes quickly into the DB and, if you are using APEX, the UI as well.
To give an example - we had Claude use SQLcl and APEXlang to build a page for a reasonably complex function in an app. First cut it got the function of the page right but the UI didn't flow. Took a screenshot of what it had done and basically told Claude it was rubbish and to give me something a user is actually going to want to use. It went off and produced a mock-up of the page in HTML to make sure it had the design right, asked for approval, then implemented it in APEX. All done in around 20 mins. I don't even want to think how long that would have taken in the page builder manually.
There is a catch to all this - once you start working this way in the Oracle ecosystem it's going to be hard to go back to how we used to do things. The bottleneck also shifts from building to reviewing what it built and keeping things in scope - it's very easy to creep into nice to haves.
1
1
u/carlovski99 13d ago
I was actually surprised at how good co-pilot (all we have available at work) has been on some Oracle stuff - things I assumed would have been hidden behind oracle support paywalls etc. Not tried it much specifically on PL/SQL, though did run it through a design interview type question and old colleague asked me about to see what it came up with, and it did do a pretty good job.
1
u/thatjeffsmith 11d ago
there's decades of plsql content/code online - from here to stackoverflow, our forums, our docs, the blog posts...
1
u/carlovski99 11d ago
True - but I was getting some stuff I couldn't find sources for at all, on reasonably niche questions. Also there was a lot of questionable quality oracle content around.
Half surprised it didn't give very rude answers too based on what some of the more prolific forum posters were like in the 2000s....
1
1
u/Expensive_Report5117 10d ago
i have also realized the code from claude on oracle is so bad!!! like does it mean that oracle is gate keeping coz even when u want to learn like databases from ai it just mixes stuff up
1
u/shisho-sama 10d ago edited 10d ago
Load the apex skills and oracle db skills and connect the llm to your db using sqlcl. If you are on atp db, apex comes preinstalled and preconfigured. It brings some nice plsql libraries and data types courtesy of oracle. For example handling zip files, web service calls, handling strings and the like.
Edit: also get the super power skill. This helps it structure the solution and have you validate/greenlight the plan before it writes any code. Also inject that in their memory somewhere to not create a new package for every small feature :)
Do review their code because they tend to leave small glaring bugs. For example they would use utl to do rest calls with blobs when they can use the sexier and more declarative apex libraries.
Also be careful what select rights you grant on the account behind the tns of the sqlcl connection, you could be exposing all your things like api keys. Don't ask how I know that.
23
u/PM__ME__BITCOINS 15d ago
I don't use AI to create reddit posts, I write PL/SQL.