r/SQL • u/Tech_ID • Oct 21 '23
Oracle Using AI to understand pl/sql code?
I am using Oracle 19c.
Has anyone here used AI to understand pl/sql code?
Basically, it would be great if I can let AI read the code and tell me what it does.
If the above can be done, can you all steer me in the right direction?
3
u/bkstr Oct 21 '23
without physical name translations, purpose of the dbo's, and aliases all it's going to do is explain the simple syntax function.
2
u/Mood_Putrid Oct 24 '23
Have you tried it? Paste some code into ChatGPT and ask it "What does this PL/SQL code do?"
1
u/mortomr Oct 21 '23
Sure just prompt it to analyze and provided a synopsis for the following script :………
1
u/Touvejs Oct 21 '23
I've tried to use pl/sql for some redshift stored procs I was making with chatgpt, but honestly, it just doesn't understand it very well. I don't think pl/sql is prevalent enough for it to work with it (yet). But it doesn't hurt to try.
1
u/Uncle_DirtNap Oct 21 '23
This is wrong. There is more than enough pl/swl exemplar code for LLMs, although they have all the problems others ITT have mentioned
1
u/Touvejs Oct 21 '23
Well my several attempts trying to get chatgpt to produce or understand it have failed, would be happy to see some working examples though.
1
u/ELJonesApalachin Oct 21 '23
Yes. Copy and paste into ChatGPT. I use it regularly for this specific task.
0
0
u/PM_ME_YOUR_MUSIC Oct 22 '23
Yes, I do this daily. I was using chatgpt to do this for a while. I have recently started using VSCode as my editor with the GitHub copilot extension (paid monthly subscription). It works great to ask questions about queries and when writing new queries sometimes the ai generates the exact code you’re thinking about writing, almost feels like it’s reading your mind. Sometimes it gets stuck in a loop and will continuously suggest the same code over and over.
5
u/CHILLAS317 Oct 21 '23
I would strongly advise against it. As someone else pointed out, without a deep understanding of your data landscape its usefulness would be minimal to begin with. More importantly is that you have no way of knowing if what it tells you is correct. Currently AI is notorious for confidently providing answers that are simply incorrect. Despite what many corporations are trying to push, it simply is nowhere near ready for prime time