Feb 142014
 
insert into my_reading_list (
  book, author
) values  (
  'Oracle PL/SQL Programming, 6th Edition',
  'Steven Feuerstein'
);

That’s right, Steven Feuerstein – PL/SQL expert and all round great guy – has recently published the 6th edition of his PL/SQL programming book. It includes the new features of Oracle for 12c as well as general advice and principles for PL/SQL programming. If you want to keep up to date with what’s changed or are starting out with PL/SQL I recommend you get yourself a copy!

Jan 172014
 

Here’s another quiz. The procedure below is executed, “something” is run and the output changes on the next execution:

exec why_does_the_output_change;

from this

-- What happens here?

exec why_does_the_output_change;

to this

To cover off the easy options – no change is made to the code of the procedure and there’s no SQL within it (so the “mystery code” isn’t updating/inserting/deleting table data for example).

What did I do? Put your answers in the comments!

(Just as I finished writing this I thought of a second way this could be done, though arguably it involves a code change – can you get them both? Are there more options?)

Jan 232013
 
begin
  $if $$deploying_to_many_environments and 
      $$these_have_different_setups $then

    use_conditional_compliation();

  $else

    you_have_to_change_your_code();
    to_solve_dependency_issues();

  $end
end;
/
Dealing with conditional compliation can bring it's own complications,
but at least it means you can have a consistent and repeatable release process

For a script showing this in action, use this. For a more detailed description, see this article on the always excellent oracle-base.