Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 83401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:46:04+00:00 2026-05-10T21:46:04+00:00

I’m getting increasingly frustrated with the limitations and verbosity required to actually commit some

  • 0

I’m getting increasingly frustrated with the limitations and verbosity required to actually commit some business logic to stored procedures, using languages such as Transact-SQL or PL/SQL. I would love to convert some current databases to Oracle and take advantage of its support for Java stored procedures, but that option is not available at the moment.

What alternatives would you recommend in the way of databases that support stored procedures in other languages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:46:05+00:00Added an answer on May 10, 2026 at 9:46 pm

    There are some architectural obstacles to having more clever query languages in a database manager. The principal one is the query optimiser. One of the design constraints on SQL is that it can only use constructs that are accessible to the query optimiser. This means that the language and its capabilities are quite tightly coupled to the capabilities of the query execution engine and query plan optimiser.

    The other major design constraint is the mechanical nature of the database system – database programming is almost unique in that it has a mechanical component. Query performance is limited by the mechanical constraints of disk head seeks and rotational latency (the wait time before the data you want arrives under the heads).

    This effectively precludes many clever abstractions that might make SQL more powerful or easier to work with. Many database management systems supplement SQL with procedural alternatives that can be used for scripting. However, they interact with the DBMS by executing a series of SQL queries that are processed by the optimiser individually. Some languages of this type that are shipped with various DBMS platforms are:

    • Oracle’s PL/SQL and embedded Java. PL/SQL is actually based on Ada – it is quite ‘old school’ by modern standards and has a legacy code base with which it must remain backwardly compatible. It’s not necessarily the most pleasant programming environment but it does have constructs for facilities such as parallelism and a reasonably flexible type system. One of the major criticisms of Java stored procedures on Oracle is that you are paying for Oracle’s capacity based licensing on the CPU you are running the JVM’s on.

    • SQL Server CLR Integration. Somewhat similar to Oracle’s Java Stored Procedures, this allows CLR modules compiled from C# (or any .net language) to be loaded into a SQL Server instance and executed in much the same way as stored procedures. SQL Server also has PostgreSQL-style API’s for making custom aggregate functions through CLR integration and other hooks for mixed SQL/CLR code bases.

    • PostgreSQL is actually the system where back-end language integration was originally developed. The system exports a native C API with facilities for custom aggregate functions, storage engines, procedural extensions and other functionality. The language interfaces are based on this API and include: PL/pgSQL (a bespoke language similar to PL/SQL), Python, Perl and Tcl.

      This made it into the mainstream through Illustra, a commercialised version of Postgres, which was then bought out by Informix (which was subsequently bought out by IBM). The key features were incorporated into Informix On-Line, which is still sold by IBM.

    One key limitation of these languages is their limited interaction with the query optimiser (although the C API for PostgreSQL does have support for this). Participation in a query plan as first-class citizen requires that the query optimiser can work out a sensible view of the resources your action will take. In practice, this type of interaction with the query optimiser is mainly useful for implementing storage engines.

    This level of digging into the storage engine is (a) somewhat esoteric if the functionality is available at all (so most people won’t have the skill to do this) and (b) probably considrably more trouble than just writing the query in SQL. The limitations of the query optimiser mean that you will probably never get the level of abstration out of SQL that you might get from (say) Python or even C# or Java.

    The path of least resistance for efficient queries is likely to be writing the query in SQL with some procedural glue in one of the other languages. In some cases a computation really does lend itself to a procedural approach.

    This can become a hassle and lead to large bodies of boilerplate SQL code. The only real options for this are hand coded SQL or code generation systems. A trivial example of code generation is the CRUD functionality provided by frameworks where this SQL is generated from metadata. A more complex example can be seen in ETL tools such as Oracle Warehouse Builder or Wherescape Red which work by generating great screeds of stored procedure code from the model.

    I find myself building code generation systems of one sort or another on a semi-regular basis for precisely this reason. Any templating system will do for this – I’ve had fairly good mileage from CherryTemplate but there are many such items around. Code Generation in Action is quite a good book on this subject – the author uses a ruby-based system whose name escapes me.

    Edit: If you look at a ‘Show Estimated Execution Plan’ for a block of procedural code you will notice that each statement has its own query plan. The query optimisation algorithm can only work on a single SQL statement, so a procedure will have a forest of query plans. Because procedural code can have ‘side-effects‘ you cannot use the type of algorithms used in query optimisation to reason about the code. This means that a query optimiser cannot globally optimise a block of procedural code. It can only optimise individual SQL statements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 57k
  • Answers 57k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer WPF doesn't really support this intrinsically. However, there are some… May 11, 2026 at 8:31 am
  • added an answer WinDbg will be able to do this, but it's not… May 11, 2026 at 8:31 am
  • added an answer Here is my solution: Declare this struct to store the… May 11, 2026 at 8:31 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.

      Related Questions

      No related questions found