Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternatives to PL/SQL? Are there any other programming language/IDE combos that offer autocomplete and syntax validation for (Oracle) SQL queries? [closed]

I'm looking for an alternative to PL/SQL. PL/SQL is mediocre at best but I haven't found anything that's even close to matching its productivity when writing Oracle database-centric scripts.

So, are there any other programming languages that offer any of the following features?

  • Natively handle SQL queries (SQL treated as code, not as a string).
  • Autocomplete for table & column names.
  • SQL is validated against DB at compile time.

*Edit: I'm well aware of, and use, IDEs for SQL and PL/SQL that offer autocomplete. I'm merely wondering if there exists any other programming language out there that lets you intermingle SQL and code in a similar way to PL/SQL.

like image 488
ivanatpr Avatar asked Feb 22 '23 21:02

ivanatpr


1 Answers

"Awkward exception handling, a lack of many built-in datatypes and functions that you take for granted in most languages, lack of anything resembling proper support for multi-threaded programming, inability to access the filesystem of the person running the script (SSH access to prod DB servers is often out of the question), hugely awkward for OOP, dealing with packages can be a PITA, doesn't respect role-base grants, etc... PL/SQL is awesome when it comes to integration with the DB, but beyond that it's a fairly poor language once you go past a certain level of complexity."

One by one.

Awkward exception handling
Awkwardness is in the eye of the beholder but I'll give you that one. Too much is left up to the individual developer.

a lack of many built-in datatypes ... that you take for granted in most languages
It has the same datatypes as SQL, plus BOOLEAN. What more can you want?

lack of anything resembling proper support for multi-threaded programming
Multithreading is a tricky concept to combine with read-consistency in a multi-user environment. The Aurora JVM doesn't support mult-threaded Java in Java Stored Procedures either. It's not a limitation of PL/SQL.

inability to access the filesystem of the person running the script
Again, that's not a PL/SQL issue. Ask your network administrator to map a fileshare on your PC to the network.

hugely awkward for OOP
Yeah well, OOP is on its way out, everybody's down with functional programming these days.

dealing with packages can be a PITA
Personal opinion. I love packages.

doesn't respect role-base grants
Again, that's not PL/SQL, it's the database security model. Views don't respect role-based grants either.

once you go past a certain level of complexity
Write it in Java and call if from a Java Stored Procedure. Or write it on C and call it from an extproc.

like image 68
APC Avatar answered Feb 26 '23 03:02

APC