Sokrates on Oracle

Best Practice in 12c

Posted by Matthias Rogel on 4. December 2013

Since PL/SQL now is closely integrated into SQL, we hence can happily state

sokrates@12.1 > with function bestpractice return varchar2
  2  is
  3  begin
  4     return 'Do not use PL/SQL when it can be done with SQL alone !';
  5  end bestpractice;
  6  select bestpractice() from dual
  7  /

BESTPRACTICE()
--------------------------------------------------------------------------------
Do not use PL/SQL when it can be done with SQL alone !

About these ads

2 Responses to “Best Practice in 12c”

  1. Nice post – looks like something I’d write ;)

  2. there is also a partly documented subquery usage with WITH_PLSQL

    CREATE TABLE t
    AS
    SELECT /*+ WITH_PLSQL */ *
    FROM (WITH FUNCTION bestpractice
    RETURN VARCHAR2
    IS
    BEGIN
    RETURN ‘Do not use PL/SQL when it can be done with SQL alone !';
    END bestpractice;
    SELECT bestpractice ()
    FROM DUAL);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: