view counter

PL/SQL Feed

Oracle PL/SQL (Procedural Language/Structured Query Language) resources, news, and support articles.

Function or Procedure?

Somebody asked for a simple comparison between a PL/SQL pass-by-value function and pass-by-reference procedure, where the procedure uses only an OUT mode parameter to return the result. This provides examples of both, but please note that a pass-by-value function can be used in SQL or PL/SQL context while a pass-by-reference procedure can only be used in another anonymous of named block PL/SQL program.

Comments in hint

 
It seems that CBO can work with the line comment inside sql hints.
Let’s see. I create a table with 3 indexes:
--drop table ttt purge;
create table ttt
(
a number not null,
b number not null,
c number not null
);

insert into ttt
select 1,1,1
from dual connect by level <= 10000;
commit;

create index iiia on ttt(a);
create index iiib on ttt(b);
create index iiic on ttt(c);
And then I’m able to switch access paths by commenting:

Different error handling behavior between EXECUTE IMMEDIATE and DBMS_SQL (11296)

One of the Q4 2011 playoff quizzes examined the way that user-defined exceptions are handled. If you didn't participate in the playoff, you may want to view this quiz - even try to answer it for yourself - before reading this post.

Q4 2011 Championship Playoff Results

You will find below the rankings for the Q4 2011 playoff; the number next to the player's name is the number of times that player has participated in a playoff. Congratulations first and foremost to our top-ranked players:

1st Place: Frank Schrader, Germany, wins an Amazon.com US$250 Gift Card.
2nd Place: Janis Baiza, Latvia, wins an Amazon.com US$175 Gift Card.
3rd Place: Valentin Nikotin, Russia, wins an Amazon.com US$100 Gift Card.

A Conversation with Hans Forbrich

Hans Forbrich, an Oracle ACE Director, talks about his path to becoming a prized speaker at Oracle User Group meetings around the world. http://medianetwork.oracle.com/video/player/961894745001 Enjoy all Saurabh Filed under: Oracle Tagged: Oracle, oracle user group, Saurabh, video player

Compiling Incomplete Program Units (9633)

The 25 January quiz tested your knowledge of the minimal amount of code needed to "create" a PL/SQL procedure in the data dictionary, even if the resulting program unit is invalid.

The choices offered were:

CREATE PROCEDURE plch_test;
CREATE PROCEDURE plch_test AS;
CREATE PROCEDURE plch_test NULL;
CREATE PROCEDURE plch_test IS BEGIN NULL; END;

The first was scored as incorrect and the last three as correct.

Caclulating Entropy and Gini Index for a partitioned table

20th century has been highlighted by the two notable insights onto the nature of information. In 1948, Claude Shannon published classic paper “A Mathematical Theory of Communication” suggesting quantitative information measure — entropy — as average number of bits needed to store or communicate one symbol in a message. The paper has tremendous impact: it launched the whole new discipline — the Information Theory.

Comparing Schemas: Red Gate Schema Compare for Oracle

This week I attended a webinar by Cary Millsap, organized by Red Gate. It was called "Real Developers DO use Tools" and was focussed on, well, tools. At the end of Cary's talk, James Murtagh showed a demo of their Schema Compare tool. The demo wasn't flawless, but he recovered nicely :) (note to self: don't do live demo's).

Q4 2011 Championship Playoff on 25 January

The 7th quarterly championship playoff of the PL/SQL Challenge will take place on Wednesday, 25 January.

Forty-two players qualified to participate. In this playoff, players will have 30 minutes in which to take five quizzes. Scoring and ranking for the playoff follows the same formula used for the daily quiz.

Exploring DBMS_UTILITY.FORMAT_CALL_STACK (9628)

The 18 January quiz tested your knowledge of the contents of strings returned by a call to DBMS_UTILITY.FORMAT_CALL_STACK, which (roughly speaking) answers the question: "How did I get here?" (with a nod to the Talking Heads, one of my all-time favorite bands)

Iudith Mentzel went exploring and came up with some interesting tidbits that I thought I would share.

view counter