Skip to main content

A new name - and amazing new future - for PL/SQL

Note: You might think that this was published on April 2nd, but in fact it was published on April 1st.

PL/SQL, the database programming language from Oracle, introduced in 1991 and used by millions over the years to implement data APIs and business logic in mission critical applications from which billions of humans benefit daily, is undergoing a radical transformation in order to stay relevant for, and meta-cool to, future generations of developers.

After a careful examination of all modern programming languages and the definitive StackOverflow developer surveys, the PL/SQL development team implemented a super-secret plan (yes, that’s correct, even the Distinguished Product Manager for PL/SQL, Bryn Llewellyn, is unaware of what you are about to read. So don’t bother him about it, OK?).

I am, therefore, inordinately pleased and honored to be the first to announce the following changes for PL/SQL in Oracle Database 20c:
  1. PL/SQL will now be a case-insensitive language. Sort of.
  2. Only lower-case letters will be supported.
  3. All keywords will now be encased within squiggly brackets. 
  4. The name of the language will change to {plsql}. 
  5. SQL statements are replaced by “yo, oracle!” commands.
  6. All procedures and functions are implemented as recursive callback functions executed asynchronously across all Oracle Database instances in all parallel universes available through the Oracle Quantum Universe Cloud Service.
Let’s take a look at how {plsql} differs from PL/SQL.

Here’s “Hello World” in PL/SQL 18c:

BEGIN
   DBMS_OUTPUT.PUT_LINE (‘Hello World’);
EXCEPTION 
   WHEN OTHERS 
   THEN
      NULL;
END;
/

And now in {plsql}:

{begin}
    {'Hello {dbms_output(.)put_line} World’)(call)(home)(et);
    {wotn};
{end};
/

And you won’t recognize it, but you sure will be impressed by what’s happened to “select from dual”.

DECLARE
   l_dummy sys.dual.dummy%TYPE;
BEGIN
   SELECT dummy
     INTO l_dummy
     FROM sys.dual;
END;
/

And now in {plsql}:

{declare}
   l_dummy {yooracle}”What’s the type of dummy in dual?”;
{begin}
   {yooracle}”What’s the value of dummy in dual?”:l_dummy;
{end};
/

For really complicated SQL statements, you might want to switch to the even more flexible and powerful MLC (“machine learning cloud”) mode, demonstrated so ably below:

{begin}
   {ihaveadream}”What’s the running total for all orders placed 
                last month by customers located within a kilometer 
                of their parents?”
   => {oraclevrconsole};
{end};
/

I could go on and on and on and on and on and on and on and on and on and on (Seriously, I could. The Oracle Quantum Universe Cloud Service, while not available in April 2018,  is up and running in 2020. I am using it to spray tachyons backwards and forwards through time, thereby allowing  me to sign up for as many Oracle Public Cloud trials as I want and write this mind-boggling post).

I could even show you an example of a recursive callback function executed asynchronously across all Oracle Database instances in all parallel universes.

But I won’t. I like you too much.

2018 marks the 37th year I am have working with PL/SQL I am proud of the many achievements of Oracle Database developers over those years. And today, on April 1, 2018, I am confident of a “squiggly bright” future for {plsql} over the next 37 years.

Join me for the journey!



Comments

  1. Hello Steven,

    Please, I beg you, don't frighten us with that "callback functions executed asynchronously" feature, as those clever Node.js guys might even take it seriously :) ...

    Cheers and hope to still continue to travel together in the {PL/SQL} journey :)

    Best Regards,
    Iudith

    ReplyDelete
  2. >> billions of humans benefit daily

    Which is even more impressive, taking into account, that it was developed by and for the inhabitants of Aldebaran system :-)

    ReplyDelete
  3. Please dont frighten us with thee confusing notations. Please keep the language as itis.. But atleast u can enhance to include more features like python. thats it.

    ReplyDelete
  4. Hi All ,

    I am a PL/SQL Developer with 4 year`s of experience working in an Insurance Domain Product based company.
    I have gained good knowledge on Insurance Domain and PL/SQL too.
    Kindly suggest me learning and choosing which technology for my next job would be good for my future in long run(As i am planning to get married soon).

    Thanks,
    Best Regards,
    Ganesh Dasari.
    Dasariganesh38@gmail.com

    ReplyDelete
    Replies
    1. If you are planning to get married soon, I would suggest you learn the language of compromise. It's an old one that pre-dates modern computing, but is very pertinent to your future.

      Delete
    2. Excellent idea, Martin!

      I also suggest checking out APEX - Oracle Application Express. Leverage those PL/SQL skills to build websites!

      https://apex.oracle.com

      Delete

Post a Comment

Popular posts from this blog

Running out of PGA memory with MULTISET ops? Watch out for DISTINCT!

A PL/SQL team inside Oracle made excellent use of nested tables and MULTISET operators in SQL, blending data in tables with procedurally-generated datasets (nested tables).  All was going well when they hit the dreaded: ORA-04030: out of process memory when trying to allocate 2032 bytes  They asked for my help.  The error occurred on this SELECT: SELECT  *    FROM header_tab trx    WHERE (generated_ntab1 SUBMULTISET OF trx.column_ntab)       AND ((trx.column_ntab MULTISET             EXCEPT DISTINCT generated_ntab2) IS EMPTY) The problem is clearly related to the use of those nested tables. Now, there was clearly sufficient PGA for the nested tables themselves. So the problem was in executing the MULTISET-related functionality. We talked for a bit about dropping the use of nested tables and instead doing everything in SQL, to avoid the PGA error. That would, however require lots of wo...

How to Pick the Limit for BULK COLLECT

This question rolled into my In Box today: In the case of using the LIMIT clause of BULK COLLECT, how do we decide what value to use for the limit? First I give the quick answer, then I provide support for that answer Quick Answer Start with 100. That's the default (and only) setting for cursor FOR loop optimizations. It offers a sweet spot of improved performance over row-by-row and not-too-much PGA memory consumption. Test to see if that's fast enough (likely will be for many cases). If not, try higher values until you reach the performance level you need - and you are not consuming too much PGA memory.  Don't hard-code the limit value: make it a parameter to your subprogram or a constant in a package specification. Don't put anything in the collection you don't need. [from Giulio Dottorini] Remember: each session that runs this code will use that amount of memory. Background When you use BULK COLLECT, you retrieve more than row with each fetch, ...

PL/SQL 101: Three ways to get error message/stack in PL/SQL

The PL/SQL Challenge quiz for 10 September - 16 September 2016 explored the different ways you can obtain the error message / stack in PL/SQL. Note: an error stack is a sequence of multiple error messages that can occur when an exception is propagated and re-raised through several layers of nested blocks. The three ways are: SQLERRM - The original, traditional and (oddly enough) not currently recommended function to get the current error message. Not recommended because the next two options avoid a problem which you are unlikely  to run into: the error stack will be truncated at 512 bytes, and you might lose some error information. DBMS_UTILITY.FORMAT_ERROR_STACK - Returns the error message / stack, and will not truncate your string like SQLERRM will. UTL_CALL_STACK API - Added in Oracle Database 12c, the UTL_CALL_STACK package offers a comprehensive API into the execution call stack, the error stack and the error backtrace.  Note: check out this LiveSQL script if...