Skip to main content

Posts

Dinodate, PL/SQL as Scripting Language Liberator, watch the show!

As I mentioned in a previous post , I had an awful lot of fun with Christopher Jones doing our PL/SQL: The Scripting Language Liberator talk at OOW. PL/SQL: The Scripting Language Liberator : While scripting languages go in and out of favor, Oracle Database and PL/SQL persist, managing data and implementing business logic. This session walks through a web application to show how PL/SQL can be integrated for better logic encapsulation and performance; how Oracle's supplied packages can be used to enhance application functionality and reduce application complexity; and how to efficiently use scripting language connection and statement handling features to get better performance and scalability. Techniques shown in this session are applicable to mobile, web, or midtier applications written in languages such as JavaScript, Python, PHP, Perl, or Ruby on Rails. Using the right tool for the right job can be liberating. Once word got out around Oracle that we would be unveiling Di...

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...

The PL/SQL Whisperer

[oreiginally published at FeuerThoughts in December 2011] I spent two days in Berlin, training 25 developers at an event sponsored by  DOAG . Then I headed over to the Netherlands to spend a couple of days with 37 developers at an  AMIS -sponsored training. But on Tuesday, after I completed the first day of training without the assistance of a microphone, my voice said "Bye, bye!" I woke up Wednesday morning to discover I had lost the ability to speak above a whisper . DOAG hustled, did what was necessary, and brought in a portable microphone/speaker system. AMIS made certain to have the same ready to go on Thursday.  And so for three straight days, I  whispered  about new features of PL/SQL in 11g and much more besides. The attendees were very good natured about this less than optimal situation. One person said it made the whole class more exciting - it was as though I was giving away secrets, that no one should hear- except for the very special people in at...

My Ninth OOW - and first as an Oracle employee

Before heading out to San Fran last Thursday for meetings and the ACE Director briefing, I happened to pick up my Oracle PL/SQL Advanced Programming with Packages (my second book, published in 1996, immediately following up from the 1995 publication of my Oracle PL/SQL Programming text at IOUW in Phillie).  Here’s what I found taped inside the cover: That was the first Oracle Open World ever, and I was still working for SSC, the consulting firm I joined when I left Oracle in 1992. Must confess: don’t remember anything about OOW96, but I know how to count. Here’s some OOW math: I have attended OOW96, 97, 98, 99 2000….2014: nine Oracle Open Worlds. During that time I published nine books on PL/SQL and one (with primary author Guy Harrison) on MySQL Stored Procedures; I wrote one or two automated testing frameworks for PL/SQL, and racked up 2M miles on American Airlines - ignoring my family as I traversed a sizeable chunk of human-occupied Earth presenting on PL/S...

Coming down to earth at OOW14

Before I joined Oracle, I was honored to be an ACE Director for several years, and boy did I get spoiled. Especially at Oracle Open World time. Oracle paid for my airfare and hotel. They set up the hotel reservation. They picked me up in (non-stretch) limo and delivered me to that hotel. They drove me back to the airport. Nice.... Then I rejoined Oracle in March of this year. In late August, I was talking with a friend at Oracle and mentioned that I had yet to arrange my hotel. "Whaaaat?" she practically screeched in the phone. "You don't have your hotel? Oh, Steven, you better get on that right away." Turns out I had received an email on 7 July saying, in effect, "Congrats, Steven as Oracle employee. We have confirmed your registration for the now. NOW GO RESERVE YOUR HOTEL ROOM." But I didn't notice that last part. Just filed the email away. So I followed the advice of my friend, and went on-line to get my hotel reservation set up. ...

Use COLUMN_VALUE when selecting from scalar table function

Received this question today: I don’t have a problem to select from collection when collection is based on objects with columns/attributes. What about a collection defined as: TYPE list_of_numbers_t IS TABLE OF NUMBER; What would be the column name when you select from the collection? Short answer: COLUMN_VALUE Longer answer: here's a script I used to demonstrate several different features of nested tables. See query at bottom. CREATE OR REPLACE TYPE list_of_names_t    IS TABLE OF VARCHAR2 (100); / GRANT EXECUTE ON list_of_names_t TO PUBLIC / DECLARE    happyfamily     list_of_names_t := list_of_names_t ();    children        list_of_names_t := list_of_names_t ();    grandchildren   list_of_names_t := list_of_names_t ();    parents         list_of_names_t := list_of_names_t (); BEGIN    /* Can extend in "bulk" - 6 at once here */    hap...

RTFM? KISS? Comment? Whatever, just get the code to work right!

We've been hitting a snag of late with new registrants at the PL/SQL Challenge . As with many sites, to ensure that a person's email is not being hijacked, we send an email with a verification URL. It was working for quite a while, but then we noticed players reporting a bug: On clicking the verification link am getting an error message like: The PL/SQL Challenge website is temporarily unavailable. Please try again later or join the PL/SQL Challenge twitter group: PLSQLChallenge Sorry for the inconvenience. Ugh. Well, the site is certainly available. So what's going on? Turns out the verification URL is missing the all-important "/pls/": This: http://www.plsqlchallenge.com/apex/f?p=QDB_PROD:34:::::P34_USER,P34_CODE:... should be this: http://www.plsqlchallenge.com/pls/apex/f?p=QDB_PROD:34:::::P34_USER,P34_CODE:... Looked into the code and found:    FUNCTION apex_website_url RETURN VARCHAR2    IS    BEGIN ...