view counter

PL/SQL Feed

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

MySQL Triggers with Logging

Somebody asked why you can’t implement MySQL triggers that write information when you want to stop the DML statement, like autonomous procedures in Oracle. The question was a surprise but I didn’t find anything on it, so here’s how you can do it. This is more or less like an autonomous process by leveraging both the InnoDB and MyISAM engine’s behaviors. This post leverages an earlier explanation of MySQL Triggers.

MySQL 5.6 Install Steps

My install instructions on the web site were old, somebody wanted me to publish another set of screen capture for the MySQL 5.6 install and configuration. This is it for Windows 7 using the downloadable MSI file.

Installation Steps

The installation from MySQL’s perspective is actually the installation and configuration of MySQL. For your convenience and reference, I’ve already installed the pre-requisites for MySQL. They’re:

Results of the Q1 2013 PL/SQL Championship

You will find below the results for the Q1 2013 PL/SQL championship; the number next to the player's name is the number of times that player has participated in a championship.

Congratulations first and foremost to our top-ranked players:

1st Place: kowido of Germany wins: Amazon.com US$250 Gift Card .

2nd Place: Frank Schrader of Germany wins: Amazon.com US$175 Gift Card.

3rd Place: Vincent Malgrat of the French Republic wins: Amazon.com US$100 Gift Card.

A Private Place to Manage Working Data

create global temporary table
contains_data_that_is (
only_visible_to_one_session
varchar2(1) default 'Y',
and_by
varchar2(50) default 'removed on commit',
unless_you_state
integer
) on commit preserve rows;

I've always found the "global" naming of temporary tables slightly confusing,
as

One Database, One Package, Multiple Codepaths

create edition allows_one_plsql_object
as child of itself_with_differing_code;

comment on edition allows_one_plsql_object is
'so you can release changes with no dowmtime!';

Releasing changes to server side PL/SQL in 24x7, always up databases can be a big challenge.

SQL*Plus tips #4: Branching execution

Today I’ll show trick how we can use branching in SQL*Plus.
Although I previously showed the conditional execution of scripts and it really can be used for branching, but today I’ll show how to do it without splitting the script into several smaller scripts. In contrast to the conditional script execution, I’ll use a different method.
It is very simple, as usual – if you want to execute only one part of script, you can just comment out all unnecessary. So depending on the conditions, we can execute a script which will start a comment.

Who needs rows…

insert into when_you_can_have_columns (
reason_1,
reason_2,
reason_3,
reason_4,
reason_5
) values (
'Joins are a #!@% to write',
'Aggregation functions are a pain',
'You''re not in 1st normal form',
'You''re limited to 1000 values',
'To add more reasons needs a schema change'
);

A similar design flaw is to implement rows as a column separated list "over

Finding DBMS_TYPES value?

Somebody asked me why they can’t query the DBMS_TYPES.TYPECODE_OBJECT value because they get an ORA-06553 error. Their query attempt is:

SELECT   dbms_types.typecode_object
FROM     dual;

Naturally, it raises the following exception:

Insane Set Differences

select grip_on_reality
from parental_sanity
minus
select
ear_piercing_screaming
from baby;

no rows selected
"Insanity is hereditary; you get it from your children." - Sam Levenson

select posts from sqlfail

view counter