<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>OraNA :: Database Applications Development</title><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/orana_dbd" /><language>en</language><managingEditor>noemail@noemail.org (OraNA.info)</managingEditor><lastBuildDate>Wed, 10 Mar 2010 21:35:56 PST</lastBuildDate><generator>Google Reader http://www.google.com/reader</generator><gr:continuation xmlns:gr="http://www.google.com/schemas/reader/atom/">CNO-k_z-pKAC</gr:continuation><feedburner:info uri="orana_dbd" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><description>Read and monitor Oracle Database applications development related blogs and news sources, all in one place.</description><item><title>Lesson learned today</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/GMiVxfzOT70/lesson-learned-today.html</link><category>disasters</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jeffrey Kemp</dc:creator><pubDate>Wed, 10 Mar 2010 21:35:39 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/b604a91cb65ec2d7</guid><description>Comment out all &amp;quot;DROP TABLE&amp;quot; commands in my scripts.(I accidentally hit F5 when the focus was in the wrong window - which happened to contain a &amp;quot;DROP TABLE / CREATE TABLE&amp;quot; script - my Toad session goes and happily drops the table that I&amp;#39;d been gradually accumulating statistics into for the past 3 days - and no, there&amp;#39;s no flashback table in 9i)At least I kept all my scripts - rerunning them all&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/GMiVxfzOT70" height="1" width="1"/&gt;</description><feedburner:origLink>http://jeffkemponoracle.blogspot.com/2010/03/lesson-learned-today.html</feedburner:origLink></item><item><title>Everything is a Bit Bucket</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/dLl3kXw7a4E/everything-is-bit-bucket.html</link><category>rant</category><category>moneill</category><category>database</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Wed, 10 Mar 2010 10:39:23 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/3c0d3dcbc34c7eca</guid><description>By:  Michael O'Neill&lt;br&gt;&lt;a href="http://twitter.com/oraclenude"&gt;@oraclenude&lt;/a&gt;&lt;br&gt;&lt;a href="http://oraclenude.crisatunity.com"&gt;oraclenude.crisatunity.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;In response to &lt;a href="http://www.oraclenerd.com/2010/03/database-is-bucket-mentality.html"&gt;Chet's frustration&lt;/a&gt; over yet another encounter with a database agnostic, I wanted to contribute my first article to the &lt;span&gt;oraclenerd&lt;/span&gt; franchise.  My thoughts seemed too long for the comment stream.&lt;br&gt;&lt;br&gt;I ascribe the kernel of thought behind "the database is a bit bucket" primarily to each and every database vendor that ever existed.  Every database vendor, in an effort to persuade users of competitive products to adopt their product, has participated willingly in espousing some core aspect of how "same as the other guy" their product is in addition to whatever differentiation pitch they have.&lt;br&gt;&lt;br&gt;Now, the generally weak-minded and lazy developer (yes, I think the majority of developers are in fact weak-minded and lazy) latches on to the vendor's selective "sameness" claims for professional and personal reasons. (full disclosure: I am both an Oracle DBA and .NET developer)&lt;br&gt;&lt;br&gt;Professionally, because they are financially invested in writing third-party code not database code.  To them, the less they spend learning and understanding the particulars of things like databases, operating systems, networks, human beings, etc. the better. Personally, because there is a dominate thread in the culture of developers to dismiss the database as interesting or meaningful. It is a form of heresy to show affection towards any platform in any specificity.&lt;br&gt;&lt;br&gt;This is why Java's Big Lie of "write once, run any where" swoons so many.  Java's Big Lie is analogous to "the database is a bit bucket" by declaring that even the language of software code should be as absolutely interchangeable as possible - even at the expense of being cost-effective or useful. There is an unquestioned faith that decoupling everything from everything is a good thing.  This faith gives us code that is as far from the simplest thing that could work from the first moment writing the code is undertaken.  It is a faith I reject.  That's why I'm an &lt;span&gt;ORACLENERD&lt;/span&gt;.&lt;br&gt;&lt;br&gt;P.S. I know oraclenude and oraclenerd is confusing. It's supposed to be.&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-7386172181594358762?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe src="http://feedads.g.doubleclick.net/~ah/f/6p7ktmke358ctodn2cmf0ug8sg/300/250?ca=1&amp;amp;fh=280#http%3A%2F%2Fwww.oraclenerd.com%2F2010%2F03%2Feverything-is-bit-bucket.html" width="100%" height="280" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/dLl3kXw7a4E" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/VZF9C3NAM_Y/everything-is-bit-bucket.html</feedburner:origLink></item><item><title>Parallel query distribution methods</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/UrU_j9-l4tc/</link><category>SQL Fun</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tonyhasler</dc:creator><pubDate>Wed, 10 Mar 2010 08:38:58 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/706b907c375ea849</guid><description>&lt;p&gt;A while ago I started to investigate the possibility of using parallel query on some large tables. These large tables were partitioned by date and joined together. It struck me that using subpartitioning on the join column I could get good results.&lt;/p&gt;
&lt;p&gt;As I had learned from Christian Antognini’s excellent &lt;a href="http://antognini.ch/top/"&gt;book&lt;/a&gt; this would allow a “Full Partition-wise Joins”. Let me describe how this should have helped in my case.&lt;/p&gt;
&lt;p&gt;Let us assume that we are joining two tables T1 and T2 both partitioned by range on a date column D1 and sub-partitioned by hash on the join column J1. It should be possible for a parallel query slave to join one sub-partition from T1 to its corresponding subpartition from T2 without any need to communicate with any other parallel query slaves.&lt;/p&gt;
&lt;p&gt;So I wrote a test script:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
set autotrace off
DROP TABLE T1;

CREATE TABLE T1(D1 DATE, J1 CHAR(2000), C1 CHAR(2000))
PCTFREE 99 -- To make the table a reasonable size
PARTITION BY RANGE (D1)
   SUBPARTITION BY HASH (J1)
      SUBPARTITIONS 8 (PARTITION P1
                          VALUES LESS THAN (DATE &amp;#39;2010-01-02&amp;#39;)
                      ,PARTITION P2
                          VALUES LESS THAN (DATE &amp;#39;2010-01-03&amp;#39;)
                      ,PARTITION P3
                          VALUES LESS THAN (DATE &amp;#39;2010-01-04&amp;#39;)
                      ,PARTITION P4
                          VALUES LESS THAN (DATE &amp;#39;2010-01-05&amp;#39;)
                      ,PARTITION P5
                          VALUES LESS THAN (DATE &amp;#39;2010-01-06&amp;#39;))

PARALLEL(DEGREE 4);

DROP TABLE T2;

CREATE TABLE T2(D1 DATE, J1 CHAR(2000), C1 CHAR(2000))
PCTFREE 99 -- To make the table a reasonable size
PARTITION BY RANGE (D1)
   SUBPARTITION BY HASH (J1)
      SUBPARTITIONS 8 (PARTITION P1
                          VALUES LESS THAN (DATE &amp;#39;2010-01-02&amp;#39;)
                      ,PARTITION P2
                          VALUES LESS THAN (DATE &amp;#39;2010-01-03&amp;#39;)
                      ,PARTITION P3
                          VALUES LESS THAN (DATE &amp;#39;2010-01-04&amp;#39;)
                      ,PARTITION P4
                          VALUES LESS THAN (DATE &amp;#39;2010-01-05&amp;#39;)
                      ,PARTITION P5
                          VALUES LESS THAN (DATE &amp;#39;2010-01-06&amp;#39;))

PARALLEL(DEGREE 4);

INSERT INTO T1(D1, J1, C1)
       SELECT   DATE &amp;#39;2010-01-03&amp;#39;, ROWNUM, ROWNUM
         FROM   DUAL
   CONNECT BY   LEVEL &amp;lt;= 30000;

INSERT INTO T2(D1, J1, C1)
       SELECT   DATE &amp;#39;2010-01-03&amp;#39;, ROWNUM, ROWNUM
         FROM   DUAL
   CONNECT BY   LEVEL  &amp;lt;=30000);

BEGIN
   DBMS_STATS.GATHER_TABLE_STATS(USER
                                ,&amp;#39;T1&amp;#39;
                                ,estimate_percent =&amp;gt; 100);
   DBMS_STATS.GATHER_TABLE_STATS(USER
                                ,&amp;#39;T2&amp;#39;
                                ,estimate_percent =&amp;gt; 100);
END;
/

set autotrace traceonly
set timing on
ALTER SESSION SET EVENTS &amp;#39;10053 trace name context forever&amp;#39;;
--
-- First let us try without the hint
--

SELECT   COUNT( * )
  FROM   T1, T2
 WHERE       t1.d1 = DATE &amp;#39;2010-01-03&amp;#39;
         AND t2.d1 = DATE &amp;#39;2010-01-03&amp;#39;
         AND t1.j1 = t2.j1;

--
-- And now hinted
--

SELECT /*+ leading(t1, t2) pq_distribute(t2 none none) */
      COUNT( * )
  FROM   T1, T2
 WHERE       t1.d1 = DATE &amp;#39;2010-01-03&amp;#39;
         AND t2.d1 = DATE &amp;#39;2010-01-03&amp;#39;
         AND t1.j1 = t2.j1;

ALTER SESSION SET EVENTS &amp;#39;10053 trace name context forever&amp;#39;;
set autotrace off
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Although parallel query was deployed I got a sub-optimal distribution method that not only took longer but used twice as many parallel query slaves as necessary unless I added hints. First the execution plan unhinted:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
----------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name     | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| P
----------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |          |     1 |  4018 |  2090   (1)| 00:00:11 |       |
|   1 |  SORT AGGREGATE               |          |     1 |  4018 |            |          |       |
|   2 |   PX COORDINATOR              |          |       |       |            |          |       |
|   3 |    PX SEND QC (RANDOM)        | :TQ10001 |     1 |  4018 |            |          |       |
|   4 |     SORT AGGREGATE            |          |     1 |  4018 |            |          |       |
|*  5 |      HASH JOIN                |          | 30000 |   114M|  2090   (1)| 00:00:11 |       |
|   6 |       PX RECEIVE              |          | 30000 |    57M|  1044   (0)| 00:00:06 |       |
|   7 |        PX SEND BROADCAST LOCAL| :TQ10000 | 30000 |    57M|  1044   (0)| 00:00:06 |       |
|   8 |         PX BLOCK ITERATOR     |          | 30000 |    57M|  1044   (0)| 00:00:06 |     1 |
|*  9 |          TABLE ACCESS FULL    | T2       | 30000 |    57M|  1044   (0)| 00:00:06 |    17 |
|  10 |       PX BLOCK ITERATOR       |          | 30000 |    57M|  1044   (0)| 00:00:06 |     1 |
|* 11 |        TABLE ACCESS FULL      | T1       | 30000 |    57M|  1044   (0)| 00:00:06 |    17 |
----------------------------------------------------------------------------------------------------
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and now hinted:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
----------------------------------------------------------------------------------------------------
| Id  | Operation                       | Name     | Rows  | Bytes | Cost (%CPU)| Time     | Pstart|
----------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                |          |     1 |  4018 |  2090   (1)| 00:00:11 |       |
|   1 |  SORT AGGREGATE                 |          |     1 |  4018 |            |          |       |
|   2 |   PX COORDINATOR                |          |       |       |            |          |       |
|   3 |    PX SEND QC (RANDOM)          | :TQ10000 |     1 |  4018 |            |          |       |
|   4 |     SORT AGGREGATE              |          |     1 |  4018 |            |          |       |
|   5 |      PX PARTITION HASH ALL      |          | 30000 |   114M|  2090   (1)| 00:00:11 |     1 |
|*  6 |       HASH JOIN                 |          | 30000 |   114M|  2090   (1)| 00:00:11 |       |
|   7 |        PX PARTITION RANGE SINGLE|          | 30000 |    57M|  1044   (0)| 00:00:06 |     3 |
|*  8 |         TABLE ACCESS FULL       | T1       | 30000 |    57M|  1044   (0)| 00:00:06 |    17 |
|   9 |        PX PARTITION RANGE SINGLE|          | 30000 |    57M|  1044   (0)| 00:00:06 |     3 |
|* 10 |         TABLE ACCESS FULL       | T2       | 30000 |    57M|  1044   (0)| 00:00:06 |    17 |
----------------------------------------------------------------------------------------------------
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The curious thing was that no matter what distribution mechanism I picked the cost was the same!&lt;/p&gt;
&lt;p&gt;I asked Christian about this and his full reply came in &lt;a href="http://antognini.ch/2010/01/does-the-query-optimizer-cost-px-distribution-methods/"&gt;this blog&lt;/a&gt;. Christian was able to explain why the estimated costs in the execution plan were misleading and further suggested that my problem with the wrong distribution mechanism was due to partition elimination. I changed my query to remove the date predicate but this didn’t help.&lt;/p&gt;
&lt;p&gt;So I took Christian’s lead and looked at the 10053 trace file. The following is an extract of the relevant section of the trace file for the un-hinted query:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
-- Enumerating distribution methods for #Hash Join:
---- &lt;strong&gt;cost NONE = 0.00&lt;/strong&gt;  Outer table:
    resc: 3759.85  card 30000.00  bytes: 2009  deg: 4  resp: 1044.40
  Inner table: T2  Alias: T2
    resc: 3759.85  card: 30000.00  bytes: 2009  deg: 4  resp: 1044.40
    using dmeth: 129  #groups: 1
    Cost per ptn: 0.62  &lt;strong&gt;#ptns: 8&lt;/strong&gt;
    hash_area: 16430 (max=82150)       buildfrag: 926  probefrag: 926  passes: 1
  Hash join: Resc: 7524.65  Resp: 2090.04  [multiMatchCost=0.00]
&lt;strong&gt;---- cost(Hash Join) = 2090.04 (w/o dist), 2090.04 (w/ dist)&lt;/strong&gt;
---- cost VALUE = 16.16
---- cost with slave mapping = 6.07
  Outer table:
    resc: 3759.85  card 30000.00  bytes: 2009  deg: 4  resp: 1044.40
  Inner table: T2  Alias: T2
    resc: 3759.85  card: 30000.00  bytes: 2009  deg: 4  resp: 1044.40
    using dmeth: 2  #groups: 1
    Cost per ptn: 0.74  &lt;strong&gt;#ptns: 4&lt;/strong&gt;
    hash_area: 16430 (max=82150)       buildfrag: 1851  probefrag: 1851  passes: 1
  Hash join: Resc: 7522.65  Resp: 2089.54  [multiMatchCost=0.00]
&lt;strong&gt;---- cost(Hash Join) = 2089.54 (w/o dist), 2095.61 (w/ dist)&lt;/strong&gt;
---- cost PARTITION-RIGHT = 4.04
  Outer table:
    resc: 3759.85  card 30000.00  bytes: 2009  deg: 4  resp: 1044.40
  Inner table: T2  Alias: T2
    resc: 3759.85  card: 30000.00  bytes: 2009  deg: 4  resp: 1044.40
    using dmeth: 192  #groups: 1
    Cost per ptn: 0.62  &lt;strong&gt;#ptns: 8&lt;/strong&gt;
    hash_area: 16430 (max=82150)       buildfrag: 926  probefrag: 926  passes: 1
  Hash join: Resc: 7524.65  Resp: 2090.04  [multiMatchCost=0.00]
&lt;strong&gt;---- cost(Hash Join) = 2090.04 (w/o dist), 2094.08 (w/ dist)&lt;/strong&gt;
---- cost PARTITION-LEFT = 4.04
  Outer table:
    resc: 3759.85  card 30000.00  bytes: 2009  deg: 4  resp: 1044.40
  Inner table: T2  Alias: T2
    resc: 3759.85  card: 30000.00  bytes: 2009  deg: 4  resp: 1044.40
    using dmeth: 160  #groups: 1
    Cost per ptn: 0.62  &lt;strong&gt;#ptns: 8&lt;/strong&gt;
    hash_area: 16430 (max=82150)       buildfrag: 926  probefrag: 926  passes: 1
  Hash join: Resc: 7524.65  Resp: 2090.04  [multiMatchCost=0.00]
&lt;strong&gt;---- cost(Hash Join) = 2090.04 (w/o dist), 2094.08 (w/ dist)&lt;/strong&gt;
---- cost BROADCAST-RIGHT = 31.94
---- cost with slave mapping = 0.00
  Outer table:
    resc: 3759.85  card 30000.00  bytes: 2009  deg: 4  resp: 1044.40
  Inner table: T2  Alias: T2
    resc: 3759.85  card: 30000.00  bytes: 2009  deg: 4  resp: 1044.40
    using dmeth: 8  #groups: 8
    Cost per ptn: 0.69  #ptns: 4
    hash_area: 16430 (max=82150)       buildfrag: 1851  probefrag: 926  passes: 1
  Hash join: Resc: 7522.46  Resp: 2089.50  [multiMatchCost=0.00]
  Outer table:
    resc: 3759.85  card 30000.00  bytes: 2009  deg: 4  resp: 1044.40
  Inner table: T1  Alias: T1
    resc: 3759.85  card: 30000.00  bytes: 2009  deg: 4  resp: 1044.40
    using dmeth: 16  #groups: 8
    Cost per ptn: 0.67  &lt;strong&gt;#ptns: 4&lt;/strong&gt;
    hash_area: 16430 (max=82150)       buildfrag: 926  probefrag: 1851  passes: 1
  Hash join: Resc: 7522.36  Resp: 2089.47  [multiMatchCost=0.00]
&lt;strong&gt;---- cost(Hash Join) = 2089.47 (w/o dist), 2089.47 (w/ dist)&lt;/strong&gt;
---- cost BROADCAST-LEFT = 31.94
---- cost with slave mapping = 0.00
  Outer table:
    resc: 3759.85  card 30000.00  bytes: 2009  deg: 4  resp: 1044.40
  Inner table: T2  Alias: T2
    resc: 3759.85  card: 30000.00  bytes: 2009  deg: 4  resp: 1044.40
    using dmeth: 16  #groups: 8
    Cost per ptn: 0.67  &lt;strong&gt;#ptns: 4&lt;/strong&gt;
    hash_area: 16430 (max=82150)       buildfrag: 926  probefrag: 1851  passes: 1
  Hash join: Resc: 7522.36  Resp: 2089.47  [multiMatchCost=0.00]
&lt;strong&gt;---- cost(Hash Join) = 2089.47 (w/o dist), 2089.47 (w/ dist)&lt;/strong&gt;
(newjo-save)    [1 0 ]
Final - All Rows Plan:  Best join order: 1
 &lt;strong&gt; Cost: 2089.5431&lt;/strong&gt;  Degree: 4  Card: 30000.0000  Bytes: 120540000
  Resc: 7522.6511  Resc_io: 7518.0000  Resc_cpu: 36316296
  Resp: 2089.5431  Resp_io: 2088.3333  Resc_cpu: 9445741
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can see that the difference between the cost without distribution (2090.04) and that with (2090.04) is zero for the desired plan (shown first) and that the difference for other distribution methods is either also zero or positive. However, the total cost for some of the other distribution methods is lower! This is because the cost without the distribution is not constant. This in turn seems to be because in some distribution methods the number of partitions (subpartitions in our case) has been correctly calculated as 8 and in other cases the number of partitions has been set to 4 – the degree of parallelism! I confirmed that when altering the degree of parallelism this number changed accordingly.&lt;/p&gt;
&lt;p&gt;One other oddity: Although the selected distribution mechanism has a cost less than 2090.04 (2089.5431) it is not the lowest possible according to the trace (2089.47). But that is a problem for another day.&lt;/p&gt;
&lt;p&gt;It struck me that a good workaround for what seems to be a bug is to ensure that the number of sub-partitions and the degree of parallelism is the same. Let us try it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ALTER TABLE t1 PARALLEL(DEGREE 8);
ALTER TABLE t2 PARALLEL(DEGREE 8);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Voila! The correct plan is produced unhinted.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;----------------------------------------------------------------------------------------------------
| Id  | Operation                       | Name     | Rows  | Bytes | Cost (%CPU)| Time     | Pstart|
----------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                |          |     1 |  4018 |  1045   (1)| 00:00:06 |       |
|   1 |  SORT AGGREGATE                 |          |     1 |  4018 |            |          |       |
|   2 |   PX COORDINATOR                |          |       |       |            |          |       |
|   3 |    PX SEND QC (RANDOM)          | :TQ10000 |     1 |  4018 |            |          |       |
|   4 |     SORT AGGREGATE              |          |     1 |  4018 |            |          |       |
|   5 |      PX PARTITION HASH ALL      |          | 30000 |   114M|  1045   (1)| 00:00:06 |     1 |
|*  6 |       HASH JOIN                 |          | 30000 |   114M|  1045   (1)| 00:00:06 |       |
|   7 |        PX PARTITION RANGE SINGLE|          | 30000 |    57M|   522   (0)| 00:00:03 |     3 |
|*  8 |         TABLE ACCESS FULL       | T1       | 30000 |    57M|   522   (0)| 00:00:03 |    17 |
|   9 |        PX PARTITION RANGE SINGLE|          | 30000 |    57M|   522   (0)| 00:00:03 |     3 |
|* 10 |         TABLE ACCESS FULL       | T2       | 30000 |    57M|   522   (0)| 00:00:03 |    17 |
----------------------------------------------------------------------------------------------------
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So here is the tip of the day:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Set the number of partitions or sub-partitions and the degree of parallelism to be the same when performing full partition-wise joins.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have reproduced the results in this blog entry both on 10.2.04 and 11.1.0.6.&lt;/p&gt;
&lt;br&gt;  &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tonyhasler.wordpress.com/297/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tonyhasler.wordpress.com/297/"&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tonyhasler.wordpress.com/297/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tonyhasler.wordpress.com/297/"&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tonyhasler.wordpress.com/297/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tonyhasler.wordpress.com/297/"&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tonyhasler.wordpress.com/297/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tonyhasler.wordpress.com/297/"&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tonyhasler.wordpress.com/297/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tonyhasler.wordpress.com/297/"&gt;&lt;/a&gt; &lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tonyhasler.wordpress.com&amp;amp;blog=4263781&amp;amp;post=297&amp;amp;subd=tonyhasler&amp;amp;ref=&amp;amp;feed=1"&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/UrU_j9-l4tc" height="1" width="1"/&gt;</description><media:group xmlns:media="http://search.yahoo.com/mrss/"><media:content url="http://0.gravatar.com/avatar/238d8e3b0ec2784e7f30a442e8c999e8?s=96&amp;d=identicon&amp;r=G" /></media:group><feedburner:origLink>http://tonyhasler.wordpress.com/2010/03/10/parallel-query-distribution-methods/</feedburner:origLink></item><item><title>Developers Against Inappropriate Concatenation</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/EMBNEQGKOo4/developers-against-inappropriate.html</link><category>rant</category><category>concat</category><category>oracle</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gary Myers</dc:creator><pubDate>Wed, 10 Mar 2010 03:00:01 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/42913ec9ccb3d2d9</guid><description>Tom Kyte is on &lt;a href="http://tkyte.blogspot.com/2006/09/classic-example-of-why-i-despise.html"&gt;record&lt;/a&gt; as wanting the abolition of "WHEN OTHERS", "Autonomous Transactions" and "Triggers". I think he's also mention COMMIT in procedures too.&lt;br&gt;&lt;br&gt;For today's rant, I'm going up against the humble concatenation operator. Yup the double pipe ( || ), or concat if you want to be 'portable'.&lt;br&gt;&lt;br&gt;Not entirely, of course. I'm not a zealot.I recognize that sometimes you'll need to join a State to a Postcode (or Zip code) when outputting an address.&lt;br&gt;&lt;br&gt;But they should only be in the top-most SELECT. Not in a subselect, or a predicate. And definitely not if you are inserting the combined value into another column. The first rule about normalisation is you don't talk about normalisation. No, sorry that's Fight Club. But First Normal Form does include &lt;a href="http://en.wikipedia.org/wiki/First_normal_form#Atomicity"&gt;Atomicity&lt;/a&gt;, which means you shouldn't be gluing fields together. This is a data model, not an &lt;a href="http://www.airfix.com/"&gt;Airfix&lt;/a&gt; model.&lt;br&gt;&lt;br&gt;If you do "column_a||column_b", you'll get confused about whether 'abc' was 'ab'||'c' or 'a'||'bc' and be lost.&lt;br&gt;&lt;br&gt;Even if you are smart and stick some delimiter in there (column_a||'-'||column_b), you've lost your columns. Can't use them for Referential Integrity. Can't gather stats on them. The optimizer is going to get lost. If the original columns were numbers or dates, you've added datatype conversion into the mix. If both the original values were null, you've got nothing but a delimiter in the new field. Yuck.&lt;br&gt;&lt;br&gt;But mostly, at some time in the future some poor blighter is going to have to come along and break them apart with obscure regular expressions. It may be me, and I won't be happy. And then you'll find out what I can do with a double pipe !&lt;div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/13265058-4880910753098038823?l=blog.sydoracle.com" alt=""&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/EMBNEQGKOo4" height="1" width="1"/&gt;</description><feedburner:origLink>http://blog.sydoracle.com/2010/03/developers-against-inappropriate.html</feedburner:origLink></item><item><title>MySQL Standard Group By</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/7pHNJBHpOt0/</link><category>LAMP</category><category>MAMP</category><category>MySQL</category><category>sql</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">maclochlainn</dc:creator><pubDate>Tue, 09 Mar 2010 22:54:12 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/2a9705187be58ae5</guid><description>&lt;p&gt;Teaching SQL is interesting because folks try syntax that should be broken. It was interesting when I discovered what should be broken from my perspective but was expected behavior in MySQL.&lt;/p&gt;
&lt;p&gt;You can select a set of non-aggregated columns with an aggregated column, and exclude one, more than one, or all of the non-aggregated columns from the &lt;code&gt;GROUP BY&lt;/code&gt; clause. It’s explained in &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/group-by-hidden-columns.html"&gt;Chapter 11.12.3 of the MySQL 5.1 Reference&lt;/a&gt;. Appropriately, the process is called group by hidden columns.&lt;/p&gt;
&lt;p&gt;This query actually runs in a generically configured MySQL instance without an error. It returns a meaningless non-grouped by column value. I wonder if there’s code out there that’s returning unintended data sets because of this behavior.&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt;   key_one
&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;        key_two
&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;        SUM&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;counter&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;FROM&lt;/span&gt;     grouping
&lt;span style="color:#993333;font-weight:bold"&gt;GROUP&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;BY&lt;/span&gt; key_one;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can prevent the default behavior for the &lt;code&gt;GROUP BY&lt;/code&gt; clause &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html"&gt;by adding the &lt;code&gt;ONLY_FULL_GROUP_BY&lt;/code&gt; mode variable&lt;/a&gt; to your &lt;code&gt;SQL_MODE&lt;/code&gt; system variable. After setting this system variable, a &lt;code&gt;GROUP BY&lt;/code&gt; without all non-aggregated columns should raise the following exception:&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;ERROR &lt;span style="color:#cc66cc"&gt;1055&lt;/span&gt; &lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;42000&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;: &lt;span style="color:#ff0000"&gt;'sampledb.grouping.key_two'&lt;/span&gt; isn&lt;span style="color:#ff0000"&gt;'t in GROUP BY&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can add the &lt;code&gt;ONLY_FULL_GROUP_BY&lt;/code&gt; mode variable during a session with the following syntax:&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#993333;font-weight:bold"&gt;SET&lt;/span&gt; SQL_MODE&lt;span style="color:#66cc66"&gt;=&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; CONCAT&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;@@sql_mode&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;',ONLY_FULL_GROUP_BY'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or, you can start the &lt;code&gt;mysqld&lt;/code&gt; with the following option:&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;mysqld --sql_mode=&lt;span style="color:#ff0000"&gt;&amp;quot;sql_mode1,sql_mode2, ... ,sql_mode(n+1)&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A better alternative, is to add it to the &lt;code&gt;my.cnf&lt;/code&gt; configuration file on Linux, or &lt;code&gt;my.ini&lt;/code&gt; configuration file on Windows. You can add it to this line, which is done at the end of the line.&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#666666;font-style:italic"&gt;# Set the SQL mode to strict&lt;/span&gt;
sql-mode=&lt;span style="color:#ff0000"&gt;&amp;quot;STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you opt for changing it at the server configuration file, you must stop and restart the &lt;code&gt;mysqld&lt;/code&gt; process. You can do that on Windows from the command line, like this on Windows provide the service name is &lt;code&gt;mysql&lt;/code&gt;. If you’ve set the Windows service to &lt;code&gt;mysql51&lt;/code&gt;, then you need to substitute &lt;code&gt;mysql51&lt;/code&gt; for &lt;code&gt;mysql&lt;/code&gt;.&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;NET STOP mysql
NET START mysql&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can also shut the system down with the following command:&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;mysqladmin &lt;span style="color:#660033"&gt;-uroot&lt;/span&gt; &lt;span style="color:#660033"&gt;-p&lt;/span&gt; shutdown&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div style="padding-left:20px;background:#FFFFFF"&gt;
&lt;p title="Click to see content ..."&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:125%"&gt;Complete Code Sample&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; &lt;span&gt;↓&lt;/span&gt;&lt;/p&gt;
&lt;p style="clear:both"&gt;
Expand this section to see the sample working code.&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;This builds the &lt;code&gt;GROUPING&lt;/code&gt; table, inserts nine rows, and tests it before and after setting the variable in the session. The change reverts after you exit and re-enter the database.&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#808080;font-style:italic"&gt;-- Conditionally drop sample table.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; &lt;span style="color:#ff0000"&gt;'DROP TABLE IF EXISTS grouping'&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;AS&lt;/span&gt; &lt;span style="color:#ff0000"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;;
&lt;span style="color:#993333;font-weight:bold"&gt;DROP&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;TABLE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;IF&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;EXISTS&lt;/span&gt; grouping;
 
&lt;span style="color:#808080;font-style:italic"&gt;-- Create sample table.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; &lt;span style="color:#ff0000"&gt;'CREATE TABLE grouping'&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;AS&lt;/span&gt; &lt;span style="color:#ff0000"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;;
&lt;span style="color:#993333;font-weight:bold"&gt;CREATE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;TABLE&lt;/span&gt; grouping
&lt;span style="color:#66cc66"&gt;(&lt;/span&gt; key_one   CHAR&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;5&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; key_two   CHAR&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;5&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; counter   INT &lt;span style="color:#993333;font-weight:bold"&gt;UNSIGNED&lt;/span&gt; &lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
&lt;span style="color:#808080;font-style:italic"&gt;-- Insert nine rows into the sample table.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; &lt;span style="color:#ff0000"&gt;'INSERT INTO grouping'&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;AS&lt;/span&gt; &lt;span style="color:#ff0000"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;INSERT&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;INTO&lt;/span&gt; grouping &lt;span style="color:#993333;font-weight:bold"&gt;VALUES&lt;/span&gt;
&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'One'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Uno-1'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;1&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Two'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Due-1'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;2&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Three'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Tre-1'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;3&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'One'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Uno-2'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;1&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Two'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Due-2'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;2&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Three'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Tre-2'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;3&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'One'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Uno-3'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;1&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Two'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Due-3'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;2&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Three'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Tre-3'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;3&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
&lt;span style="color:#808080;font-style:italic"&gt;-- Query with hidden columns, no enforcement on non-aggregate columns.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; &lt;span style="color:#ff0000"&gt;'SELECT non-aggregates FROM grouping with hidden columns'&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;AS&lt;/span&gt; &lt;span style="color:#ff0000"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; key_one&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; key_two&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; SUM&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;counter&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;FROM&lt;/span&gt;   grouping
&lt;span style="color:#993333;font-weight:bold"&gt;GROUP&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;BY&lt;/span&gt; key_one;
 
&lt;span style="color:#808080;font-style:italic"&gt;-- Check current system mode variable assignment.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; &lt;span style="color:#ff0000"&gt;'SELECT @@sql_mode'&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;AS&lt;/span&gt; &lt;span style="color:#ff0000"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; @@sql_mode;
 
&lt;span style="color:#808080;font-style:italic"&gt;-- Append the mode to the existing system mode variable.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; &lt;span style="color:#ff0000"&gt;'SET SQL_MODE=(SELECT ...)'&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;AS&lt;/span&gt; &lt;span style="color:#ff0000"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;;
&lt;span style="color:#993333;font-weight:bold"&gt;SET&lt;/span&gt; SQL_MODE&lt;span style="color:#66cc66"&gt;=&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; CONCAT&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;@@sql_mode&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;',ONLY_FULL_GROUP_BY'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
&lt;span style="color:#808080;font-style:italic"&gt;-- Check modified system mode variable assignment.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; &lt;span style="color:#ff0000"&gt;'SELECT @@sql_mode'&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;AS&lt;/span&gt; &lt;span style="color:#ff0000"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;;
&lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; @@sql_mode;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;p style="clear:both"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/7pHNJBHpOt0" height="1" width="1"/&gt;</description><feedburner:origLink>http://blog.mclaughlinsoftware.com/2010/03/10/mysql-standard-group-by/</feedburner:origLink></item><item><title>APEX: Create and Parse Arrays</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/PWGmoeqBoyY/apex-create-and-parse-arrays.html</link><category>howto</category><category>apex_util</category><category>apex</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Tue, 09 Mar 2010 22:34:17 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/51aedf7d425a2ffd</guid><description>It's been awhile since I've been able to work with APEX extensively, so I am rusty.&lt;br&gt;&lt;br&gt;A question came up today whether we could get multiple values into a single variable (Item in APEX).&lt;br&gt;&lt;br&gt;Yes we can!&lt;br&gt;&lt;br&gt;&lt;a href="http://download.oracle.com/docs/cd/E11882_01/appdev.112/e12510/apex_util.htm#CHDIEDJH"&gt;APEX_UTILS&lt;/a&gt;Need some data first:&lt;pre&gt;CREATE TABLE t ( some_text VARCHAR2(10) );&lt;br&gt;&lt;br&gt;INSERT INTO t ( some_text )&lt;br&gt;SELECT dbms_random.string( 'a', 10 ) some_text&lt;br&gt;FROM dual&lt;br&gt;  CONNECT BY LEVEL &amp;lt;= 5;&lt;br&gt;&lt;br&gt;CJUSTICE@TESTING&amp;gt;SELECT * FROM t;&lt;br&gt;&lt;br&gt;SOME_TEXT&lt;br&gt;----------&lt;br&gt;thrFXviVWJ&lt;br&gt;kpfGRRwctv&lt;br&gt;EVxNrcmBHC&lt;br&gt;gcBlHaKrLa&lt;br&gt;irYduOZfkS&lt;/pre&gt;I want that table data to be in a single item. &lt;a href="http://download.oracle.com/docs/cd/E11882_01/appdev.112/e12510/apex_util.htm#CHDJBFHG"&gt;TABLE_TO_STRING&lt;/a&gt; is your function.&lt;pre&gt;VAR C VARCHAR2(100);&lt;br&gt;&lt;br&gt;DECLARE&lt;br&gt;  l_table APEX_APPLICATION_GLOBAL.VC_ARR2;&lt;br&gt;BEGIN&lt;br&gt;  SELECT some_text&lt;br&gt;  BULK COLLECT INTO l_table&lt;br&gt;  FROM t;&lt;br&gt;&lt;br&gt;  :c := apex_util.table_to_string( p_table =&amp;gt; l_table );&lt;br&gt;END;&lt;br&gt;/&lt;br&gt;&lt;br&gt;PL/SQL procedure successfully completed.&lt;br&gt;&lt;br&gt;&lt;br&gt;C&lt;br&gt;-----------------------------------------------------------&lt;br&gt;thrFXviVWJ:kpfGRRwctv:EVxNrcmBHC:gcBlHaKrLa:irYduOZfkS&lt;/pre&gt;Easy enough.  How about converting it back to a table?  &lt;a href="http://download.oracle.com/docs/cd/E11882_01/appdev.112/e12510/apex_util.htm#CHDFEEJD"&gt;STRING_TO_TABLE&lt;/a&gt; is your answer.&lt;pre&gt;DECLARE&lt;br&gt;  l_table APEX_APPLICATION_GLOBAL.VC_ARR2;&lt;br&gt;BEGIN&lt;br&gt;  l_table := apex_util.string_to_table( p_string =&amp;gt; :c );&lt;br&gt;  &lt;br&gt;  FOR i IN 1..l_table.COUNT LOOP&lt;br&gt;    d( 'value ' || i || ':  ' || l_table(i) );&lt;br&gt;  END LOOP;&lt;br&gt;END;&lt;br&gt;/&lt;br&gt;&lt;br&gt;value 1:  thrFXviVWJ&lt;br&gt;value 2:  kpfGRRwctv&lt;br&gt;value 3:  EVxNrcmBHC&lt;br&gt;value 4:  gcBlHaKrLa&lt;br&gt;value 5:  irYduOZfkS&lt;br&gt;&lt;br&gt;PL/SQL procedure successfully completed.&lt;/pre&gt;Done.&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-1177657924480438004?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/PWGmoeqBoyY" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/6A91gRqnsUw/apex-create-and-parse-arrays.html</feedburner:origLink></item><item><title>The "Database is a Bucket" Mentality</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/dCxDnjotlEc/database-is-bucket-mentality.html</link><category>rant</category><category>development</category><category>design</category><category>database</category><category>oracle</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Wed, 10 Mar 2010 17:15:38 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/4c4fed2a644033a5</guid><description>Front and center again...I just woke up from a nap, I'm grumpy, so I must write.  Besides, I haven't had a good rant in quite some time.&lt;br&gt;&lt;br&gt;Friend of mine asked me last week for some advice, specifically asking if there was a tool to convert Oracle SQL Syntax to the ANSI SQL syntax.  (A quick search turned up &lt;a href="http://www.swissql.com/products/sql-translator/sql-converter.html"&gt;this&lt;/a&gt; (it was the first result), if you're interested).&lt;br&gt;&lt;br&gt;I had to ask why.&lt;br&gt;&lt;br&gt;Client is switching to an open source database, i.e. "free."  Oracle licensing is way too pricey.&lt;br&gt;&lt;br&gt;I'm sure Oracle costs a lot of money, it's pretty darn good software.  Quite possibly the best in the world especially in the database realm.  I've written about the incredibly feature rich goodness that is the Oracle database &lt;a href="http://www.oraclenerd.com/2009/03/oracle-as-platform.html"&gt;here&lt;/a&gt; &lt;a href="http://www.oraclenerd.com/2008/05/apex-oracle-marketing-wtf.html"&gt;here&lt;/a&gt;...actually, just trust me.  It's in my name.&lt;br&gt;&lt;br&gt;Why is there even a comparison?&lt;br&gt;&lt;br&gt;Could it be that everyone out there believes that the sole purpose of a database is to store data?  That it can't do &lt;i&gt;anything&lt;/i&gt; else?  The storage and retrieval of data...that's all it does of course.&lt;br&gt;&lt;br&gt;It's like saying the Democrats and Republicans are the same...at face value, perhaps, but the devil is in the details.&lt;br&gt;&lt;br&gt;This, this "Bit Bucket" mentality is what is so incredibly frustrating.&lt;br&gt;&lt;br&gt;I am no position to argue the differences between the various flavors of database, I lack the experience.  But if I were using SQL Server, I would leverage the shit out of it's capabilities.  If I were using MySQL, I would leverage the shit out of it's capabilities.  If I were using Firebird, I would leverage the shit out of it's capabilities.  Same goes for every single flavor out there.  Get my point here?&lt;br&gt;&lt;br&gt;&lt;b&gt;The database is NOT a bit bucket!&lt;/b&gt;&lt;br&gt;&lt;br&gt;Do I need to use more 4-letter words?&lt;br&gt;&lt;br&gt;I know that Oracle is feature rich and that 99% percent of your code can live in the database...think APEX and PL/SQL.  You could probably put ALL of your code inside the database if you wanted to put the javascript in BLOBs as well.&lt;br&gt;&lt;br&gt;Please, please please quit telling me they are the same...&lt;b&gt;&lt;i&gt;they are not&lt;/i&gt;&lt;/b&gt;.&lt;br&gt;&lt;br&gt;Follow up rant by Mr. O'Neill can be found on this following post &lt;a href="http://www.oraclenerd.com/2010/03/everything-is-bit-bucket.html"&gt;Everything is a Bit Bucket&lt;/a&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-2280532480489287618?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe src="http://feedads.g.doubleclick.net/~ah/f/6p7ktmke358ctodn2cmf0ug8sg/300/250?ca=1&amp;amp;fh=280#http%3A%2F%2Fwww.oraclenerd.com%2F2010%2F03%2Fdatabase-is-bucket-mentality.html" width="100%" height="280" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/dCxDnjotlEc" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/nqAxAqyqUKk/database-is-bucket-mentality.html</feedburner:origLink></item><item><title>Why it is a sad thing when project are in the IT domain</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/NPEId6gyAYU/</link><category>CreativITy</category><category>Notions</category><category>Business</category><category>development</category><category>IT</category><category>Project</category><category>software</category><category>Strategy</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Douwe Pieter van den Bos</dc:creator><pubDate>Tue, 09 Mar 2010 14:47:56 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/6074656ee15c7222</guid><description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.flickr.com/photos/ome-b/3870240964/" title="You Got Served!"&gt;&lt;img src="http://farm3.static.flickr.com/2656/3870240964_6a81f952e4.jpg" alt="You Got Served!"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;IT projects are in the IT domain, just like Marketing projects are in the Marketing domain. Makes sense right? No, it doesn’t.&lt;/p&gt;
&lt;p&gt;When we take a look at IT projects, we need to understand the fact that the only right of existence is the fact that we support business processes. This means that we need to support and suffice the processes that make the business run, makes them tick. Any IT project is only a way to support a goal, we don’t make the goal, we don’t reach it, we just pass the right shot ahead.&lt;/p&gt;
&lt;p&gt;The days that we thought that we understand the actual processes, problems and challenges the business is in, need to lay behind us. Think of it as: ‘we just don’t get it’. This isn’t a bad thing, it’s a good thing. We are good at IT, not at running the entire business. Yet we tend to pretend we are.&lt;/p&gt;
&lt;p&gt;IT projects that mainly lay within the IT domain usually go bad, this is because the wrong people try to model and fix business problems and support business challenges. If we take out the responsibility out of the IT domain into the actual business problem owners domain, the right decisions can be made and progress is more eminent.&lt;/p&gt;
&lt;p&gt;This strategic choice means we need to get focussed on what we do best: IT. And the business can focus on what they do best: business. This results in a way of working that is much more efficient and pragmatic. We can actually help the business to achieve their goals.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/NPEId6gyAYU" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.ome-b.nl/2010/03/09/why-it-is-a-sad-thing-when-project-are-in-the-it-domain/</feedburner:origLink></item><item><title>Code Comment WTF?  Part 209</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/GP34y8dGrIk/code-comment-wtf-part-209.html</link><category>code</category><category>funny</category><category>wtf</category><category>style</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Mon, 08 Mar 2010 22:40:57 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/48594912eb68823e</guid><description>Found this in a snippet today:&lt;pre&gt;-- ********************************&lt;br&gt;-- End of Package Body&lt;br&gt;&lt;br&gt;END package_pkg ;&lt;br&gt;/&lt;/pre&gt;Seriously?  Was that necessary?  Could I possibly be under the illusion that it is &lt;i&gt;&lt;b&gt;not&lt;/b&gt;&lt;/i&gt; the end of the package?&lt;br&gt;&lt;br&gt;Stop it.&lt;br&gt;&lt;br&gt;Now.&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-875349462869366795?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rRGlclNLo3XpX2e6EO8QRTeK4wM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rRGlclNLo3XpX2e6EO8QRTeK4wM/0/di" border="0" ismap&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rRGlclNLo3XpX2e6EO8QRTeK4wM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rRGlclNLo3XpX2e6EO8QRTeK4wM/1/di" border="0" ismap&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/GP34y8dGrIk" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/EFQArUhYwsA/code-comment-wtf-part-209.html</feedburner:origLink></item><item><title>APEX: LDAP Authentication</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/m4hdtPGDPmc/apex-ldap-authentication.html</link><category>howto</category><category>apex</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Mon, 08 Mar 2010 23:10:10 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/bff242d7587a3dc6</guid><description>I got called into a discussion about an existing APEX application.  The custom LDAP functionality wasn't working as they expected.&lt;br&gt;&lt;br&gt;I knew APEX had an LDAP authentication scheme (and don't know the full history of the project so I can't (won't) comment on why it wasn't used).  So I fired up my local sandbox just to see how easy or hard it was.  Admittedly, I have always avoided anything to do with LDAP...not sure why (plate is full?).  I used &lt;a href="http://www.oracle.com/technology/products/database/application_express/howtos/how_to_ldap_authenticate.html"&gt;this&lt;/a&gt; as a guide.&lt;br&gt;&lt;br&gt;Anyway, it was remarkably easy.&lt;br&gt;&lt;br&gt;&lt;b&gt;Setup&lt;/b&gt;&lt;br&gt;APEX:  3.2.1&lt;br&gt;Web Server: Apache (OHS)&lt;br&gt;Database:&lt;pre&gt;BANNER&lt;br&gt;----------------------------------------------------------------&lt;br&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod&lt;br&gt;PL/SQL Release 10.2.0.3.0 - Production&lt;br&gt;CORE    10.2.0.3.0      Production&lt;br&gt;TNS for 32-bit Windows: Version 10.2.0.3.0 - Production&lt;br&gt;NLSRTL Version 10.2.0.3.0 - Production&lt;/pre&gt;First I fired up the web server:&lt;pre&gt;C:\oracle\http\opmn\bin&amp;gt;opmnctl start&lt;br&gt;opmnctl: opmn started&lt;br&gt;&lt;br&gt;C:\oracle\http\opmn\bin&amp;gt;opmnctl startproc process-type=HTTP_Server&lt;br&gt;opmnctl: starting opmn managed processes...&lt;/pre&gt;Opened up APEX, and created a new application.  For authentication schemes I chose "No Authentication."&lt;br&gt;&lt;br&gt;After I had created the application, I went into Shared Components --&amp;gt; Authentication Schemes --&amp;gt; Create&lt;br&gt;&lt;br&gt;Select the default and click Next&lt;br&gt;&lt;br&gt;&lt;img src="http://lh4.ggpht.com/_rhCtHYLiamQ/S5XpwjkAJuI/AAAAAAABYBY/DI4NcKLKliI/s800/01_apex.jpg" alt="step 1"&gt;&lt;br&gt;&lt;br&gt;Select "Show Login Page and Use LDAP Directory Credentials" and click Next&lt;br&gt;&lt;br&gt;&lt;img src="http://lh4.ggpht.com/_rhCtHYLiamQ/S5Xpw3Sb09I/AAAAAAABYBg/dgj_vbP6oXQ/s800/02_apex.jpg" alt="step 2"&gt;&lt;br&gt;&lt;br&gt;I've already done this so I'm selecting my current Login page, 11, click Next&lt;br&gt;&lt;br&gt;&lt;img src="http://lh4.ggpht.com/_rhCtHYLiamQ/S5XpxaM9ohI/AAAAAAABYBs/VLAcEqGvO8Q/s800/03_apex.jpg" alt="step 3"&gt;&lt;br&gt;&lt;br&gt;Enter your LDAP Host and your DN:&lt;br&gt;&lt;br&gt;&lt;img src="http://lh6.ggpht.com/_rhCtHYLiamQ/S5XpyOKAyzI/AAAAAAABYB0/mQwL8tCp-bU/s800/04_apex.jpg" alt="step 4"&gt;&lt;br&gt;&lt;br&gt;Your DN String should look something like this (from article above):&lt;pre&gt;cn=%LDAP_USER%,l=amer,dc=oracle,dc=com&lt;/pre&gt;Make sure you use the %LDAP_USER% after the cn= portion of the string.&lt;br&gt;&lt;br&gt;Name it ldap_test, click Create Scheme:&lt;br&gt;&lt;br&gt;&lt;img src="http://lh4.ggpht.com/_rhCtHYLiamQ/S5XpyK36NiI/AAAAAAABYB8/Vg_F41wOt-M/s800/05_apex.jpg" alt="step 5"&gt;&lt;br&gt;&lt;br&gt;You will then be redirected back to the list of Authentication Schemes, ldap_test should now be current&lt;br&gt;&lt;br&gt;&lt;img src="http://lh5.ggpht.com/_rhCtHYLiamQ/S5XpyX-ij8I/AAAAAAABYCE/Z1srVL3ZSIg/s800/06_apex.jpg" alt="Fini!"&gt;&lt;br&gt;&lt;br&gt;To test it just run your application and login using your LDAP (AD) credentials&lt;br&gt;&lt;br&gt;&lt;img src="http://lh5.ggpht.com/_rhCtHYLiamQ/S5Xzp3AAZvI/AAAAAAABYDs/y1-5r3zbwCE/s800/08_apex_login.jpg" alt="login"&gt;&lt;br&gt;&lt;br&gt;Success!&lt;br&gt;&lt;br&gt;&lt;img src="http://lh6.ggpht.com/_rhCtHYLiamQ/S5XzqKOEovI/AAAAAAABYD4/kismnUwQUwA/s800/09_success.jpg" alt="success!!"&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-6066666730391546161?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe src="http://feedads.g.doubleclick.net/~ah/f/6p7ktmke358ctodn2cmf0ug8sg/300/250?ca=1&amp;amp;fh=280#http%3A%2F%2Fwww.oraclenerd.com%2F2010%2F03%2Fapex-ldap-authentication.html" width="100%" height="280" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/m4hdtPGDPmc" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/YlhTbOWcvFo/apex-ldap-authentication.html</feedburner:origLink></item><item><title>March 1-7 is National Procrastination Week</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/EtpryiwhlRM/march-17-is-national-procrastination-week-37361</link><category>Off Topic</category><category>off topic</category><category>humor</category><category>npw</category><category>national procrastination week 2010</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">(author unknown)</dc:creator><pubDate>Mon, 08 Mar 2010 08:16:55 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/390f614a0c11e270</guid><description>From &lt;a href="http://it.toolbox.com/blogs/oracle-guide"&gt;An Expert's Guide to Oracle Technology&lt;/a&gt;

March 1-7 is National Procrastination Week (NPW).

&lt;strong&gt;Happy NPW!&lt;/strong&gt;

I meant to write about it last week.

But I was celebrating it instead.

;-)

LewisC&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/EtpryiwhlRM" height="1" width="1"/&gt;</description><feedburner:origLink>http://it.toolbox.com/blogs/oracle-guide/march-17-is-national-procrastination-week-37361?rss=1</feedburner:origLink></item><item><title>Weird exception handling</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/LoP4i0zowDc/weird-exception-handling.html</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rob van Wijk</dc:creator><pubDate>Mon, 08 Mar 2010 14:07:33 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/f680dc2a5ff1b8f6</guid><description>PL/SQL got me fooled today. My assignment was to build a new procedure that gets invoked together with an existing procedure. After I had build and unit tested my new procedure, the tester wanted to conduct a system integration test. He had trouble coming up with a situation where the old and new procedure were called. So I helped him by having a look at some of the surrounding code and my&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/LoP4i0zowDc" height="1" width="1"/&gt;</description><feedburner:origLink>http://rwijk.blogspot.com/2010/03/weird-exception-handling.html</feedburner:origLink></item><item><title>February Top 10</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/mQcNRpLqHUY/february-top-10.html</link><category>random</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Mon, 08 Mar 2010 10:47:01 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/92a1f5767b0258a3</guid><description>As the name implies, it's the Top 10 for this past month.  Probably the biggest reason I am doing this is the EBS Install series has become a runaway success.  I've never had something become so popular so quickly...which of course tells me I'm no good and &lt;a href="http://www.oraclenerd.com/labels/jpiwowar.html"&gt;John Piwowar&lt;/a&gt; is the best ever.  :)  &lt;br&gt;&lt;br&gt;John deserves quite a bit of recognition so the more I can provide, the better.&lt;br&gt;&lt;br&gt;&lt;table width="80%"&gt;&lt;tr&gt;&lt;td&gt;Title&lt;/td&gt;&lt;td align="right"&gt;Pageviews&lt;/td&gt;&lt;td align="right"&gt;Unique Pageviews&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2009/12/ebs-install-guide-part-1.html"&gt;EBS Install Guide - Part I&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;541&lt;/td&gt;&lt;td align="right"&gt;394&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2009/01/learning-oracle-business-intelligence.html"&gt;Learn Oracle Business Intelligency (OBIEE)&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;444&lt;/td&gt;&lt;td align="right"&gt;337&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2009/12/ebs-install-guide-part-2.html"&gt;EBS Install Guide - Part 2&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;347&lt;/td&gt;&lt;td align="right"&gt;262&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2008/04/dbmscrypto-example.html"&gt;DBMS_CRYPTO: Example&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;339&lt;/td&gt;&lt;td align="right"&gt;295&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2009/11/apex-install-321-on-11gr2.html"&gt;APEX: Install 3.2.1 on 11gR2&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;263&lt;/td&gt;&lt;td align="right"&gt;225&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2009/12/ebs-install-part-3.html"&gt;EBS Install Guide - Part 3&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;253&lt;/td&gt;&lt;td align="right"&gt;202&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//labels/obiee.html"&gt;OBIEE Posts&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;243&lt;/td&gt;&lt;td align="right"&gt;215&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2009/03/obiee-how-to-migrate-your-rpd.html"&gt;OBIEE:  How to Migrate Your rpd&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;234&lt;/td&gt;&lt;td align="right"&gt;183&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.oraclenerd.com//2008/06/bulk-collect-and-forall.html"&gt;BULK COLLECT and FORALL&lt;/a&gt;&lt;/td&gt;&lt;td align="right"&gt;187&lt;/td&gt;&lt;td align="right"&gt;166&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-7071407464105112840?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/mQcNRpLqHUY" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/sPUowCn8sJE/february-top-10.html</feedburner:origLink></item><item><title>Forced Agility and the Leap Forward</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/ie6Hzjp-Ypo/</link><category>Agile</category><category>CreativITy</category><category>Notions</category><category>DeveloperDerby</category><category>development</category><category>software</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Douwe Pieter van den Bos</dc:creator><pubDate>Mon, 08 Mar 2010 08:55:39 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/3ea57f407f392691</guid><description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.flickr.com/photos/ome-b/4409757262/" title="DeveloperDerby 2010: Thank God for Jolt Cola"&gt;&lt;img src="http://farm5.static.flickr.com/4058/4409757262_6bff405ddc.jpg" alt="DeveloperDerby 2010: Thank God for Jolt Cola"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Last friday and saturday we, at Whitehorses, had our yearly DeveloperDerby. This beautiful and fun race for developers is for our developers, by our developers. This year we had an actual client case of one of our beloved clients, Ricoh. And this is where it all changed…&lt;/p&gt;
&lt;p&gt;In previous years we developed an application for a fictional business problem. This year it was an actual problem and the client was there to help. Two Ricoh executives where available for questions, reviews and other interactions. Because the teams only got a minimum of information beforehand and they needed to deliver something that actually worked within two days, they where forced into agility. A beautiful process and very educational.&lt;/p&gt;
&lt;p&gt;Using the moments with the clients, our four development teams got all the information that was needed. All teams where made agile because there was no information to be found, not on paper, not on the web, not by experience. We had a client case that was extremely challenging and the teams needed to show their creativity in order to really grasp and solve this problem, by adding value.&lt;/p&gt;
&lt;p&gt;And value was found. Although, like everyone else, the client had a solution in mind, every team came up with a different way to solve the problem. By offering self service in a very accessible and fun way to the end clients of Ricoh, they would save money on sending personnel to their end users. Fun and pretty.&lt;/p&gt;
&lt;p&gt;The Ricoh executives where taken trough the process by all our teams, they showed solutions and prototypes, talked about different ways of looking at the problem and got new insights in helping their client base. Managing relations and offering solutions to real live problems. In short: adding value.&lt;/p&gt;
&lt;p&gt;In the end, a strange thing happened. Two of four teams where called winners. Both these teams interacted with the client on all occasions the had. Therefor had a lot of insight in what the client moved, what they would think would be sexy and attractive. Talking to them certainly helped understanding the complexity of that what really needed to be done and what was beneath it all.&lt;/p&gt;
&lt;p&gt;Agility equals success.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/ie6Hzjp-Ypo" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.ome-b.nl/2010/03/08/forced-agility-and-the-leap-forward/</feedburner:origLink></item><item><title>SQL Developer: Install Unit Testing Repository</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/40leoaIlUew/sql-developer-install-unit-testing.html</link><category>howto</category><category>sql developer</category><category>testing</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Mon, 08 Mar 2010 05:53:56 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/da818b8600fa1c27</guid><description>Get the latest SQL Developer release &lt;a href="http://htmldb.oracle.com/pls/otn/f?p=42626:16"&gt;here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;I'm not a big tools guy, I prefer SQL*Plus to anything else.  I especially don't like paying for tools (yes, the database is a tool and costs a &lt;i&gt;lot&lt;/i&gt; of money...I do realize the hypocrisy).&lt;br&gt;&lt;br&gt;After Syme Kutz's presentation at SOUG, I've been looking more closely at SQL Developer.  I've been using it (and JDeveloper) since they were both made freely available a few years ago.  Mostly for the schema browsing, looking around, importing and exporting data.  I do use it (SQL Developer) to write reports that I can share with the Business folks as well.&lt;br&gt;&lt;br&gt;Syme's presentation was primarily on Unit Testing (which I begged for).  First step to using Unit Testing is to install the repository, a set of tables the application uses to build and store tests and their results.&lt;br&gt;&lt;br&gt;You need to have version 2.1 or greater.&lt;br&gt;&lt;br&gt;First up, go to Tools --&amp;gt; Unit Test --&amp;gt; Select Current Repository&lt;br&gt;&lt;br&gt;&lt;img src="http://lh4.ggpht.com/_rhCtHYLiamQ/S5T5iACnbHI/AAAAAAABX8Q/PRHG3nhK0tw/s800/01_select_current_repo.jpg" alt="select repostory"&gt;&lt;br&gt;&lt;br&gt;You'll be prompted to select a connection (i.e. database) to use&lt;br&gt;&lt;br&gt;&lt;img src="http://lh3.ggpht.com/_rhCtHYLiamQ/S5T5ijeAC-I/AAAAAAABX8Y/BJ65Ifqmq2c/s800/02_select_connection.jpg" alt="select connection"&gt;&lt;br&gt;&lt;br&gt;Would you like to create one now?  Select Yes.&lt;br&gt;&lt;br&gt;&lt;img src="http://lh3.ggpht.com/_rhCtHYLiamQ/S5T5i09LSQI/AAAAAAABX8g/d-D6P-JiPPY/s800/03_no_repository.jpg" alt="no repository found"&gt;&lt;br&gt;&lt;br&gt;You're then told the the required roles do not exist, select OK.&lt;br&gt;&lt;br&gt;&lt;img src="http://lh5.ggpht.com/_rhCtHYLiamQ/S5T5jYDLUrI/AAAAAAABX8o/7vVyS0uqG_Y/s800/04_role_does_not_exist.jpg" alt="roles do not exist"&gt;&lt;br&gt;&lt;br&gt;Confirm running SQL&lt;br&gt;&lt;br&gt;&lt;img src="http://lh4.ggpht.com/_rhCtHYLiamQ/S5T5j01Qu9I/AAAAAAABX8w/5b8Q3fdJXT4/s800/06_running_sql.jpg" alt="confirm sql"&gt;&lt;br&gt;&lt;br&gt;Running...will take just a few seconds&lt;br&gt;&lt;br&gt;&lt;img src="http://lh4.ggpht.com/_rhCtHYLiamQ/S5T5kIOrxKI/AAAAAAABX84/yH5yMpu6BrM/s800/07_running.jpg" alt="running"&gt;&lt;br&gt;&lt;br&gt;Success!&lt;br&gt;&lt;br&gt;&lt;img src="http://lh5.ggpht.com/_rhCtHYLiamQ/S5T5kk0-riI/AAAAAAABX9A/C9bgbPfTcJc/s800/08_create_succeeded.jpg" alt="success!"&gt;&lt;br&gt;&lt;br&gt;That's it.  Easy right?  Future posts will detail managing users and creating tests.&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-1648607024059314877?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;&lt;p&gt;&lt;iframe src="http://feedads.g.doubleclick.net/~ah/f/6p7ktmke358ctodn2cmf0ug8sg/300/250?ca=1&amp;amp;fh=280#http%3A%2F%2Fwww.oraclenerd.com%2F2010%2F03%2Fsql-developer-install-unit-testing.html" width="100%" height="280" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/40leoaIlUew" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/4IFm-DiVVQc/sql-developer-install-unit-testing.html</feedburner:origLink></item><item><title>Wrap a cursor function</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/HKNU0vQJMfc/</link><category>OPAL</category><category>Oracle</category><category>Oracle XE</category><category>pl/sql</category><category>sql</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">maclochlainn</dc:creator><pubDate>Sun, 07 Mar 2010 19:14:55 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/1877b308703c4f8d</guid><description>&lt;p&gt;A &lt;em&gt;Gauss&lt;/em&gt; posted a question on my &lt;a href="http://blog.mclaughlinsoftware.com/plsql-programming/pipelined-functions-plsql-tables/"&gt; from last year’s Utah Oracle User’s Group Training Days presentation. If I understood his question correctly, this should help him work with his legacy code. Honestly, as I wrote the example something &lt;a href="http://www.oreillynet.com/pub/au/1056"&gt;&lt;em&gt;Bryn Llewellyn&lt;/em&gt;&lt;/a&gt; said kept banging around in my head, “Just because we can, doesn’t mean we should.” He was speaking of writing poorly engineered code.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sometimes, we don’t get the opportunity to re-factor existing code. That leaves us with writing wrappers that aren’t pretty or effective. A realization and preface to showing everyone how to accomplish these tasks, and perhaps a watch out warning if you choose this path. I suspect that there may be a better way but I don’t know their code tree.&lt;/p&gt;
&lt;p&gt;Here’s the question, as I understand it. They’ve got a library function in PL/SQL that returns a system reference cursor and is principally consumed by an external Java program. This type of architecture is more or less an Adapter OOAD pattern that I wrote about &lt;a href="http://blog.mclaughlinsoftware.com/2008/10/31/adapter-or-not-adapter-thats-the-question/"&gt;here&lt;/a&gt;, over a year and a half ago. The question comes to how to you wrap this approach and make it work in PL/SQL natively too.&lt;/p&gt;
&lt;p&gt;The answer depends on some earlier posts because I don’t have a great deal of time to write new examples. It uses a &lt;code&gt;COMMON_LOOKUP&lt;/code&gt; table, which is more or less a bunch of small tables grouped into a big table for use in &lt;em&gt;user interaction&lt;/em&gt; forms. That way the values don’t get lost in a large code base and are always consistently maintained. These types of tables exist in all major ERP and CRM applications.&lt;/p&gt;
&lt;p&gt;The base code for the example is &lt;a href="http://blog.mclaughlinsoftware.com/2009/03/23/object-record-collections/"&gt;found here&lt;/a&gt;, where I discussed how you can effectively use object tables – collections of user-defined object types (Oracle 9iR2 forward if I remember correctly). You can grab the full code at the bottom of the page by clicking the &lt;strong&gt;&lt;em&gt;Code Script&lt;/em&gt;&lt;/strong&gt; widget to unfold the code. That code also depends on the &lt;a href="http://www.mhprofessional.com/product.php?isbn=0071494456&amp;amp;cat=112"&gt;Oracle Database 11g PL/SQL Programming downloadable code&lt;/a&gt;, which you can download by clicking the link to the zip file location.&lt;/p&gt;
&lt;p&gt;Here are the steps to wrap a function that returns a PL/SQL reference cursor so that it can also return a PL/SQL associative array.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a package specification to hold all the components that are required to manage the process. Assuming that they may have anchored the system reference cursor to something other than a table like a shared cursor, which is a cumbersome implementation design. (I actually chose to exclude this from the book because it’s a stretch as a good coding practice. At least, it is from my perspective. Also, I couldn’t find an example in the Oracle documentation, which led me to believe they didn’t think it’s a great idea either or I could have glossed over it.) You should note that the PL/SQL &lt;code&gt;RECORD&lt;/code&gt;, Associative Array (collection), and the &lt;code&gt;REF CURSOR&lt;/code&gt; are defined in this package specification.&lt;/li&gt;
&lt;/ol&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#808080;font-style:italic"&gt;-- Create a package to hold the PL/SQL record structure.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;CREATE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;OR&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;REPLACE&lt;/span&gt; PACKAGE example &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Force cursors to be read as if empty every time.&lt;/span&gt;
  PRAGMA SERIALLY_REUSABLE;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Package-level record structure that mimics SQL object type.&lt;/span&gt;
  TYPE common_lookup_record &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt; RECORD
  &lt;span style="color:#66cc66"&gt;(&lt;/span&gt; common_lookup_id      NUMBER
  &lt;span style="color:#66cc66"&gt;,&lt;/span&gt; common_lookup_type    VARCHAR2&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;30&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
  &lt;span style="color:#66cc66"&gt;,&lt;/span&gt; common_lookup_meaning VARCHAR2&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#cc66cc"&gt;255&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Package-level collection that mimics SQL object table.&lt;/span&gt;
  TYPE common_lookup_record_table &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;TABLE&lt;/span&gt; OF common_lookup_record
  &lt;span style="color:#993333;font-weight:bold"&gt;INDEX&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;BY&lt;/span&gt; PLS_INTEGER;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Cursor structure to support a strongly-typed reference cursor.&lt;/span&gt;
  CURSOR c &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt;
    &lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt;   common_lookup_id
    &lt;span style="color:#66cc66"&gt;,&lt;/span&gt;        common_lookup_type
    &lt;span style="color:#66cc66"&gt;,&lt;/span&gt;        common_lookup_meaning
    &lt;span style="color:#993333;font-weight:bold"&gt;FROM&lt;/span&gt;     common_lookup;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Package-level strongly-typed system reference cursor.&lt;/span&gt;
  TYPE cursor_lookup &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt; REF CURSOR &lt;span style="color:#993333;font-weight:bold"&gt;RETURN&lt;/span&gt; c%ROWTYPE;
 
END;
&lt;span style="color:#66cc66"&gt;/&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Write a function to return a strongly typed system reference cursor that’s anchored to a cursor defined in the package. This is fairly straightforward when the package specification is done right. You should notice right away that anchoring the original cursor in the package was a &lt;em&gt;horrible&lt;/em&gt; practice because you must repeat it all again in the function. In my opinion, you shouldn’t anchor any system reference cursor explicitly to anything other than a table. The cursor could have used the generic weak cursor data type – &lt;code&gt;SYS_REFCURSOR&lt;/code&gt;. Doing so, saves all the extra lines required by a potential shared cursor.&lt;/li&gt;
&lt;/ol&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#993333;font-weight:bold"&gt;CREATE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;OR&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;REPLACE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;FUNCTION&lt;/span&gt; get_common_lookup_cursor
&lt;span style="color:#66cc66"&gt;(&lt;/span&gt; table_name VARCHAR2&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; column_name VARCHAR2&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;RETURN&lt;/span&gt; example&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;cursor_lookup &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Define a local variable of a strongly-typed reference cursor.&lt;/span&gt;
  lv_cursor EXAMPLE&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;CURSOR_LOOKUP;
 
BEGIN
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Open the cursor from a static cursor&lt;/span&gt;
  OPEN lv_cursor &lt;span style="color:#993333;font-weight:bold"&gt;FOR&lt;/span&gt;
    &lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt; common_lookup_id
    &lt;span style="color:#66cc66"&gt;,&lt;/span&gt;      common_lookup_type
    &lt;span style="color:#66cc66"&gt;,&lt;/span&gt;      common_lookup_meaning
    &lt;span style="color:#993333;font-weight:bold"&gt;FROM&lt;/span&gt;   common_lookup
    &lt;span style="color:#993333;font-weight:bold"&gt;WHERE&lt;/span&gt;  common_lookup_table &lt;span style="color:#66cc66"&gt;=&lt;/span&gt; table_name
    &lt;span style="color:#993333;font-weight:bold"&gt;AND&lt;/span&gt;    common_lookup_column &lt;span style="color:#66cc66"&gt;=&lt;/span&gt; column_name;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Return the cursor handle.&lt;/span&gt;
  &lt;span style="color:#993333;font-weight:bold"&gt;RETURN&lt;/span&gt; lv_cursor;
 
END;
&lt;span style="color:#66cc66"&gt;/&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Write a wrapper function that takes the reference cursor as a formal parameter and returns an Associative Array. You should note that this can’t be called from a SQL context. You must only use it in a PL/SQL context because system reference cursors are PL/SQL only data types.&lt;/li&gt;
&lt;/ol&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#993333;font-weight:bold"&gt;CREATE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;OR&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;REPLACE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;FUNCTION&lt;/span&gt; convert_common_lookup_cursor
&lt;span style="color:#66cc66"&gt;(&lt;/span&gt; pv_cursor EXAMPLE&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;CURSOR_LOOKUP&lt;span style="color:#66cc66"&gt;)&lt;/span&gt; 
&lt;span style="color:#993333;font-weight:bold"&gt;RETURN&lt;/span&gt; example&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_record_table &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Declare a local counter variable.&lt;/span&gt;
  counter INTEGER :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; &lt;span style="color:#cc66cc"&gt;1&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Local PL/SQL-only variable.&lt;/span&gt;
  out_record  EXAMPLE&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;COMMON_LOOKUP_RECORD;
  out_table   EXAMPLE&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;COMMON_LOOKUP_RECORD_TABLE;
 
BEGIN
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Grab the cursor wrapper and return values to a PL/SQL-only record collection.&lt;/span&gt;
  LOOP
    FETCH pv_cursor &lt;span style="color:#993333;font-weight:bold"&gt;INTO&lt;/span&gt; out_record;
    EXIT WHEN pv_cursor%NOTFOUND;
 
    &lt;span style="color:#808080;font-style:italic"&gt;-- Assign it one row at a time to an associative array.&lt;/span&gt;
    out_table&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;counter&lt;span style="color:#66cc66"&gt;)&lt;/span&gt; :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; out_record;
 
    &lt;span style="color:#808080;font-style:italic"&gt;-- Increment the counter.&lt;/span&gt;
    counter :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; counter &lt;span style="color:#66cc66"&gt;+&lt;/span&gt; &lt;span style="color:#cc66cc"&gt;1&lt;/span&gt;;
 
  END LOOP;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Return the record collection.&lt;/span&gt;
  &lt;span style="color:#993333;font-weight:bold"&gt;RETURN&lt;/span&gt; out_table;
 
END;
&lt;span style="color:#66cc66"&gt;/&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;You can test the program in an anonymous block, like the one below. It defines a local Associative Array variable and then assigns the system reference cursor through the wrapper.&lt;/li&gt;
&lt;/ol&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#808080;font-style:italic"&gt;-- Open the session to see output from PL/SQL blocks.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SET&lt;/span&gt; SERVEROUTPUT &lt;span style="color:#993333;font-weight:bold"&gt;ON&lt;/span&gt;
 
DECLARE
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Define a local associative array.&lt;/span&gt;
  process_table  EXAMPLE&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;COMMON_LOOKUP_RECORD_TABLE;
 
BEGIN
  &lt;span style="color:#808080;font-style:italic"&gt;-- Print title block.&lt;/span&gt;
  dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put_line&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Converting a SYS_REFCURSOR to TABLE'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
  dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put_line&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'---------------------------------------------------'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Run the dynamic variables through the cursor generating function and then convert it.&lt;/span&gt;
  process_table :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; convert_common_lookup_cursor&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;get_common_lookup_cursor&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'ITEM'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'ITEM_TYPE'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Read the content of the Associative array.  &lt;/span&gt;
  &lt;span style="color:#993333;font-weight:bold"&gt;FOR&lt;/span&gt; i &lt;span style="color:#993333;font-weight:bold"&gt;IN&lt;/span&gt; 1&lt;span style="color:#66cc66"&gt;..&lt;/span&gt;process_table&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;COUNT LOOP
    dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'['&lt;/span&gt;&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;process_table&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;i&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_id&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;&lt;span style="color:#ff0000"&gt;']'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
    dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'['&lt;/span&gt;&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;process_table&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;i&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_type&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;&lt;span style="color:#ff0000"&gt;']'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
    dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put_line&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'['&lt;/span&gt;&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;process_table&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;i&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_meaning&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;&lt;span style="color:#ff0000"&gt;']'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
  END LOOP;
 
END;
&lt;span style="color:#66cc66"&gt;/&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I hope this answers Gauss’s question. While writing it, I could envision another question that might pop-up. How do you convert an object table type to a PL/SQL context. It was an omission not to include it in that &lt;a href="http://blog.mclaughlinsoftware.com/2009/03/23/object-record-collections/"&gt;original post on object table types&lt;/a&gt;. Here’s how you wrap an object table type into a PL/SQL scope collection.&lt;/p&gt;
&lt;p&gt;You might have guessed. It’s done with another wrapper function. At least this is the easiest way to convert the SQL data type to a PL/SQL data type that I see. If you’ve another approach, a better way, let us know.&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#993333;font-weight:bold"&gt;CREATE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;OR&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;REPLACE&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;FUNCTION&lt;/span&gt; get_common_lookup_record_table
&lt;span style="color:#66cc66"&gt;(&lt;/span&gt; table_name  VARCHAR2
&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; column_name VARCHAR2 &lt;span style="color:#66cc66"&gt;)&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;RETURN&lt;/span&gt; example&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_record_table &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Declare a local counter variable.&lt;/span&gt;
  counter INTEGER :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; &lt;span style="color:#cc66cc"&gt;1&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Define a dynamic cursor that takes two formal parameters.&lt;/span&gt;
  CURSOR c &lt;span style="color:#66cc66"&gt;(&lt;/span&gt;table_name_in VARCHAR2&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; table_column_name_in VARCHAR2&lt;span style="color:#66cc66"&gt;)&lt;/span&gt; &lt;span style="color:#993333;font-weight:bold"&gt;IS&lt;/span&gt;
    &lt;span style="color:#993333;font-weight:bold"&gt;SELECT&lt;/span&gt;   &lt;span style="color:#66cc66"&gt;*&lt;/span&gt;
    &lt;span style="color:#993333;font-weight:bold"&gt;FROM&lt;/span&gt;     &lt;span style="color:#993333;font-weight:bold"&gt;TABLE&lt;/span&gt;&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;get_common_lookup_object_table&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;UPPER&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;table_name_in&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;UPPER&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;table_column_name_in&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- A local PL/SQL-only collection variable.&lt;/span&gt;
  list EXAMPLE&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;COMMON_LOOKUP_RECORD_TABLE;
 
BEGIN
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Grab the cursor wrapper and return values to a PL/SQL-only record collection.&lt;/span&gt;
  &lt;span style="color:#993333;font-weight:bold"&gt;FOR&lt;/span&gt; i &lt;span style="color:#993333;font-weight:bold"&gt;IN&lt;/span&gt; c&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;table_name&lt;span style="color:#66cc66"&gt;,&lt;/span&gt; column_name&lt;span style="color:#66cc66"&gt;)&lt;/span&gt; LOOP
    list&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;counter&lt;span style="color:#66cc66"&gt;)&lt;/span&gt; :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; i;
    counter :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; counter &lt;span style="color:#66cc66"&gt;+&lt;/span&gt; &lt;span style="color:#cc66cc"&gt;1&lt;/span&gt;;
  END LOOP;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Return the record collection.&lt;/span&gt;
  &lt;span style="color:#993333;font-weight:bold"&gt;RETURN&lt;/span&gt; list;
END get_common_lookup_record_table;
&lt;span style="color:#66cc66"&gt;/&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can then test this in an anonymous block, like so:&lt;/p&gt;

&lt;div&gt;&lt;div&gt;&lt;pre style="font-family:monospace"&gt;&lt;span style="color:#808080;font-style:italic"&gt;-- Open the session to see output from PL/SQL blocks.&lt;/span&gt;
&lt;span style="color:#993333;font-weight:bold"&gt;SET&lt;/span&gt; SERVEROUTPUT &lt;span style="color:#993333;font-weight:bold"&gt;ON&lt;/span&gt;
 
DECLARE
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Declare a local PL/SQL-only collection and assign the value from the function call.&lt;/span&gt;
  list EXAMPLE&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;COMMON_LOOKUP_RECORD_TABLE;
 
  BEGIN
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Print title block.&lt;/span&gt;
  dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put_line&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'Converting a SQL Collection to a PL/SQL Collection'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
  dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put_line&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'---------------------------------------------------'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Assign wrapped SQL collection to a PL/SQL-only collection.&lt;/span&gt;
  list :&lt;span style="color:#66cc66"&gt;=&lt;/span&gt; get_common_lookup_record_table&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'ITEM'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;,&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'ITEM_TYPE'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
 
  &lt;span style="color:#808080;font-style:italic"&gt;-- Call the record wrapper function.&lt;/span&gt;
  &lt;span style="color:#993333;font-weight:bold"&gt;FOR&lt;/span&gt; i &lt;span style="color:#993333;font-weight:bold"&gt;IN&lt;/span&gt; 1&lt;span style="color:#66cc66"&gt;..&lt;/span&gt;list&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;COUNT LOOP
    dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'['&lt;/span&gt;&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;list&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;i&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_id&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;&lt;span style="color:#ff0000"&gt;']'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
    dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'['&lt;/span&gt;&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;list&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;i&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_type&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;&lt;span style="color:#ff0000"&gt;']'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
    dbms_output&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;put_line&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000"&gt;'['&lt;/span&gt;&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;list&lt;span style="color:#66cc66"&gt;(&lt;/span&gt;i&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;&lt;span style="color:#66cc66"&gt;.&lt;/span&gt;common_lookup_meaning&lt;span style="color:#66cc66"&gt;||&lt;/span&gt;&lt;span style="color:#ff0000"&gt;']'&lt;/span&gt;&lt;span style="color:#66cc66"&gt;)&lt;/span&gt;;
  END LOOP;
 
END;
&lt;span style="color:#66cc66"&gt;/&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As always, I hope this helps somebody without paying a fee for content. &lt;img src="http://blog.mclaughlinsoftware.com/wp-includes/images/smilies/icon_wink.gif" alt=";-)"&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/HKNU0vQJMfc" height="1" width="1"/&gt;</description><feedburner:origLink>http://blog.mclaughlinsoftware.com/2010/03/07/wrap-a-cursor-function/</feedburner:origLink></item><item><title>Twitter Weekly Updates for 2010-03-07</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/6NfnS2VO9eY/</link><category>127</category><category>tweet</category><category>twitter</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lewi</dc:creator><pubDate>Sun, 07 Mar 2010 15:23:00 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/d954d4fcc6cdc6bd</guid><description>&lt;p&gt;
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;DB Geek says: Twitter Weekly Updates for 2010-02-28: &amp;lt;!–&lt;br&gt;
google_ad_client = &amp;quot;pub-4372398370642959&amp;quot;;&lt;br&gt;
/* 468×60, cr… &lt;a href="http://bit.ly/a8JhKJ" rel="nofollow"&gt;http://bit.ly/a8JhKJ&lt;/a&gt; &lt;a href="http://twitter.com/oracle_ace/statuses/9805051404"&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Blogged &amp;quot;On Everquest, Emulators and MySQL&amp;quot; &lt;a href="http://it.toolbox.com/trd/46/2/37207/3" rel="nofollow"&gt;http://it.toolbox.com/trd/46/2/37207/3&lt;/a&gt; &lt;a href="http://twitter.com/oracle_ace/statuses/9832761367"&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Blogged &amp;quot;Would you like a free pass to ODTUG Kaelidoscope 2010? How about a hotel upgrade?&amp;quot; &lt;a href="http://it.toolbox.com/trd/46/2/37247/3" rel="nofollow"&gt;http://it.toolbox.com/trd/46/2/37247/3&lt;/a&gt; &lt;a href="http://twitter.com/oracle_ace/statuses/9882322256"&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Blogged &amp;quot;The NoSQL That Must Not Be Named!&amp;quot; &lt;a href="http://it.toolbox.com/trd/46/2/37249/3" rel="nofollow"&gt;http://it.toolbox.com/trd/46/2/37249/3&lt;/a&gt; &lt;a href="http://twitter.com/oracle_ace/statuses/9981530164"&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Wtf. Ice on the car windows again. In march. I live in the freaking tundra. What&amp;#39;s next? Wooly mammoths? &lt;a href="http://twitter.com/oracle_ace/statuses/10020182395"&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;got an email from AARP. just about crapped myself. turns out it was just spam. I thought I had REALLY overslept. &lt;a href="http://twitter.com/oracle_ace/statuses/10023014520"&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MySQL Comments: My current employer doesn&amp;#39;t use Erwin so I can&amp;#39;t t…: My current employer doesn&amp;#39;t use Erwin so I … &lt;a href="http://bit.ly/9BsoS6" rel="nofollow"&gt;http://bit.ly/9BsoS6&lt;/a&gt; &lt;a href="http://twitter.com/oracle_ace/statuses/10102272292"&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Powered by &lt;a href="http://alexking.org/projects/wordpress"&gt;Twitter Tools&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/DatabaseGeekBlog/~4/YwID5qB1ql8" height="1" width="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/6NfnS2VO9eY" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/DatabaseGeekBlog/~3/YwID5qB1ql8/</feedburner:origLink></item><item><title>Advert: Queensland User Group</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/74oY882f6BA/advert-queensland-user-group.html</link><category>Conditional Compilation</category><category>AUSOUG</category><category>Presentations</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Wesley</dc:creator><pubDate>Sun, 07 Mar 2010 18:05:32 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/4d7e101a644885a9</guid><description>&lt;div style="clear:both;text-align:left"&gt;&lt;a href="http://2.bp.blogspot.com/_AK_jxmMErLU/S5RbMTyG1PI/AAAAAAAAALA/dM6TbYlO5B8/s1600-h/brissy.jpg" style="clear:left;float:left;margin-bottom:1em;margin-right:1em"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_AK_jxmMErLU/S5RbMTyG1PI/AAAAAAAAALA/dM6TbYlO5B8/s320/brissy.jpg"&gt;&lt;/a&gt;&lt;/div&gt;This is really late notice and really only applicable to Brisbane residents - but I'll be in Brisbane over the next few days and the QLD Oracle User Group has lined me up to talk PL/SQL.&lt;br&gt;&lt;br&gt;I'll be rabbiting on about &lt;i&gt;Conditional Compilation&lt;/i&gt; at Oracle House at 5:30pm, Tuesday 9th March 2010.&lt;br&gt;&lt;br&gt;Please contact &lt;a href="mailto:president.qld@ausoug.org.au"&gt;Mark Lancaster&lt;/a&gt; if you're interested.&lt;div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/4818542164384221282-8257664082920674715?l=triangle-circle-square.blogspot.com" alt=""&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/74oY882f6BA" height="1" width="1"/&gt;</description><feedburner:origLink>http://triangle-circle-square.blogspot.com/2010/03/advert-queensland-user-group.html</feedburner:origLink></item><item><title>OBIEE: Default Answers Template?</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/Wkcw7tDyydg/obiee-default-answers-template.html</link><category>obiee</category><category>answers</category><category>presentation</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">oraclenerd</dc:creator><pubDate>Sun, 07 Mar 2010 13:59:14 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/f7fbee34343ebfea</guid><description>After trying out the lazyweb method of search (aka &lt;a href="http://twitter.com"&gt;Twitter&lt;/a&gt;) and not getting much help, I resorted to help at the OTN &lt;a href="http://forums.oracle.com/forums/forum.jspa?forumID=378&amp;amp;start=0"&gt;OBIEE&lt;/a&gt; Forum.  It's not Twitter's fault, I think this problem was a bit too complex to describe in 140 characters.&lt;br&gt;&lt;br&gt;Here's the &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=1039176&amp;amp;tstart=0"&gt;post&lt;/a&gt; on OTN.  I started to get nervous too, I posted on Friday and hadn't had a response...until today.  3 days?  Man...that's way too long!&lt;br&gt;&lt;br&gt;Here's the short of it.&lt;br&gt;&lt;br&gt;Our reports were coming out funny.  Dimension column headings had one style and the Fact table column headings had another.&lt;br&gt;&lt;br&gt;&lt;img src="http://lh6.ggpht.com/_rhCtHYLiamQ/S5EUBvp6DfI/AAAAAAABXtY/SnEtDnGNKSc/s800/01_example.png" alt="dim/fact difference"&gt;&lt;br&gt;&lt;br&gt;Using &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt;, I could easily isolate the sections.&lt;br&gt;&lt;br&gt;On the Dimension column, the definition looked like this:&lt;pre&gt;&amp;lt;th  &lt;br&gt;  class="ColumnHdg" &lt;br&gt;  style="background-color: rgb(231, 231, 247); font-size: 9px; color: rgb(0, 51, 102);" &lt;br&gt;  scope="col" &lt;br&gt;  dir=&amp;quot;ltr&amp;quot;&amp;gt;Product Desc&lt;br&gt;&amp;lt;/th&amp;gt;&lt;/pre&gt;The Fact table column was defined as:&lt;pre&gt;&amp;lt;th &lt;br&gt;  class="ColumnHdg" &lt;br&gt;  scope="col" &lt;br&gt;  dir=&amp;quot;ltr&amp;quot;&amp;gt;Basis Amount&lt;br&gt;&amp;lt;/th&amp;gt;&lt;/pre&gt;Note the style attribute...that overrides any class settings.  Very annoying.&lt;br&gt;&lt;br&gt;I thought it would be relatively simple to fix.  I worked with custom messages &lt;a href="http://www.oraclenerd.com/2010/01/obiee-tooltips-in-answers.html"&gt;before&lt;/a&gt;, this had to be similar.  So I began to "grep" the messages directory&lt;pre&gt;c:\oraclebi\web\msgdb\&amp;gt;findstr /i /m /s /c:&amp;quot;background-color&amp;quot; *.*&lt;/pre&gt;Nothing.&lt;br&gt;&lt;br&gt;How about looking for the name of the class, ColumnHdg?&lt;pre&gt;c:\oraclebi\web\msgdb\&amp;gt;findstr /i /m /s /c:&amp;quot;columnhdg&amp;quot; *.*&lt;br&gt;messages\criteriatemplates.xml&lt;br&gt;messages\formattemplates.xml&lt;br&gt;messages\mktgadminuitemplates.xml&lt;br&gt;messages\mktgcommontemplates.xml&lt;br&gt;messages\mktglistformattemplates.xml&lt;br&gt;messages\mktgsegmenttemplates.xml&lt;/pre&gt;So I start with criteriatemplates.xml and find the reference to columnHdg (just now realizing that the case doesn't match...oh well).  That was part of the WebMessage kuiColumnFormulaEditor.  So I searched for that...&lt;br&gt;&lt;br&gt;You see where I'm going.&lt;br&gt;&lt;br&gt;That lead me to the javascript files (of which there are tons).  Nothing...not a single thing that could possibly be adding this style attribute.&lt;br&gt;&lt;br&gt;That's when I mapped the dev server drive to my local computer and opened up &lt;a href="http://winmerge.org/downloads/"&gt;WinMerge&lt;/a&gt;&lt;br&gt;&lt;br&gt;I then began to compare every single file in both the msgdb and res (javascript) folders.  I would then compare the files that were different to see if that could be the cause.  Still...nothing.&lt;br&gt;&lt;br&gt;I had looked in the webcat before, but couldn't find anything of global significance.  I was headed back there though since I had lost hope with custom messages and/or javascript.&lt;br&gt;&lt;br&gt;Then I got a message from the OTN Forum Administrator...could it be?  Looked at the name of the person who answered it first, &lt;a href="http://obiee101.blogspot.com/"&gt;John Minkjan&lt;/a&gt;...sweet!&lt;blockquote&gt;Looks like you forgot to reset the OOB settings when installing OBIEE:&lt;br&gt;have a look here to reset them:&lt;br&gt;&lt;a href="http://obiee101.blogspot.com/2009/02/obiee-editing-system-wide-defaults.html"&gt;http://obiee101.blogspot.com/2009/02/obiee-editing-system-wide-defaults.html&lt;/a&gt;&lt;/blockquote&gt;Click through, follow his instructions, bounce the server and voila!&lt;br&gt;&lt;br&gt;&lt;img src="http://lh5.ggpht.com/_rhCtHYLiamQ/S5QZvNrwa4I/AAAAAAABXuM/fvEM5vqARMg/s800/02_fixed.png" alt="voila!"&gt;&lt;br&gt;&lt;br&gt;As of this writing, I don't know what OOB stands for; I could make something up, but it probably wouldn't be appropriate for this family site.&lt;br&gt;&lt;br&gt;Thanks John!&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/8884584404576003487-1634881255268046159?l=www.oraclenerd.com" alt=""&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/Wkcw7tDyydg" height="1" width="1"/&gt;</description><feedburner:origLink>http://feedproxy.google.com/~r/oraclenerd/RahJ/~3/foecXmvb3Rk/obiee-default-answers-template.html</feedburner:origLink></item><item><title>jQGrid Integration Kit for PL/SQL and Apex</title><link>http://feedproxy.google.com/~r/orana_dbd/~3/jYN8pyKFdhM/jqgrid-integration-kit-for-plsql-and.html</link><category>pl/sql</category><category>jQGrid</category><category>json</category><category>Apex</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Morten Braten</dc:creator><pubDate>Sun, 07 Mar 2010 03:59:01 PST</pubDate><guid isPermaLink="false">tag:google.com,2005:reader/item/479f19dffd39f673</guid><description>&lt;p&gt;I started developing applications back in the good (?) old client/server days. I was fortunate enough to discover&lt;span&gt; &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Embarcadero_Delphi" rel="nofollow"&gt;Delphi&lt;/a&gt; quite early. Even from the start, the lowly 16-bit Delphi version 1 had a kick-ass &lt;a href="http://delphi.about.com/od/usedbvcl/a/tdbgrid.htm"&gt;DBGrid control&lt;/a&gt; which allowed you to quickly and easily build data-centric applications. Just write a SQL statement in a TDataSet component, connect it to the grid, and voila! Instant multi-row display and editing out of the box, without any coding.&lt;/p&gt;&lt;br&gt;&lt;br&gt;&lt;a href="http://1.bp.blogspot.com/_dBAKxejXABM/S5OUeUTiuEI/AAAAAAAAAR0/YimXkwOSEWM/s1600-h/delphi_dbgrid.jpg"&gt;&lt;img style="margin:0px auto 10px;display:block;text-align:center;width:400px;height:297px" src="http://1.bp.blogspot.com/_dBAKxejXABM/S5OUeUTiuEI/AAAAAAAAAR0/YimXkwOSEWM/s400/delphi_dbgrid.jpg" alt="" border="0"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;Fast forward a decade. While I do enjoy building web applications (with PL/SQL and Apex) these days, I've always missed the simplicity of that DBGrid in Delphi. Creating updateable grids with Apex is pretty tedious work (not being entirely satisfied with the built-in updateable tabular forms, I've employed a combination of the apex_item API, page processes for updates and deletes, and custom-made Javascript helpers). It doesn't help that you have to refer to the tabular form arrays by number, rather than by name (g_f01, g_f02, etc.), and that you are restricted to a total of 50 columns per page.&lt;br&gt;&lt;br&gt;&lt;p&gt;Enter &lt;a href="http://www.trirand.com/blog/"&gt;jQGrid&lt;/a&gt;, &lt;i&gt;"an Ajax-enabled JavaScript control that provides solutions for representing and manipulating tabular data on the web"&lt;/i&gt;.&lt;/p&gt;jQGrid can be integrated with any server-side technology, so &lt;a href="http://code.google.com/p/jqgrid-for-plsql/"&gt;I decided to integrate it with PL/SQL and Apex&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;a href="http://3.bp.blogspot.com/_dBAKxejXABM/S5OUCIaB2jI/AAAAAAAAARs/RXlyXC-C6_8/s1600-h/jqgrid_for_plsql_screenshot.jpg"&gt;&lt;img style="margin:0px auto 10px;display:block;text-align:center;width:400px;height:343px" src="http://3.bp.blogspot.com/_dBAKxejXABM/S5OUCIaB2jI/AAAAAAAAARs/RXlyXC-C6_8/s400/jqgrid_for_plsql_screenshot.jpg" alt="" border="0"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;h2&gt;Features&lt;/h2&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;As of version 1.0, the jQGrid for PL/SQL and Apex has the following features:&lt;/p&gt;&lt;br&gt;&lt;br&gt;&lt;ul&gt;&lt;br&gt;&lt;li&gt;Single line of PL/SQL code to render grid&lt;/li&gt;&lt;br&gt;&lt;li&gt;Populate data based on REF CURSOR or SQL text (with or without bind variables). The REF CURSOR support is based on my &lt;a href="http://ora-00001.blogspot.com/2010/02/ref-cursor-to-json.html"&gt;REF Cursor to JSON&lt;/a&gt; utility package.&lt;/li&gt;&lt;br&gt;&lt;li&gt;Define display modes (read only, sortable, editable) and edit types (checkbox, textarea, select list) per column&lt;/li&gt;&lt;br&gt;&lt;li&gt;Store grid configuration in database, or specify settings via code (for read-only grids)&lt;/li&gt;&lt;br&gt;&lt;li&gt;Ajax updates (insert, update, delete) based on either automatic row processing (dynamic SQL) or against your own package API&lt;/li&gt;&lt;br&gt;&lt;li&gt;Multiple grids per page&lt;/li&gt;&lt;br&gt;&lt;li&gt;Integrated logging and instrumentation&lt;/li&gt;&lt;br&gt;&lt;li&gt;Usable without Apex (for stand-alone PL/SQL Web Toolkit applications) or with Apex, optionally integrated with Apex session security&lt;/li&gt;&lt;br&gt;&lt;/ul&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;The jQGrid Integration Kit for PL/SQL is free and open source. &lt;a href="http://code.google.com/p/jqgrid-for-plsql/"&gt;&lt;b&gt;Download and try it now!&lt;/b&gt;&lt;/a&gt;.&lt;/p&gt;&lt;div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/5215551487816981140-8763802797709351003?l=ora-00001.blogspot.com" alt=""&gt;&lt;/div&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/orana_dbd/~4/jYN8pyKFdhM" height="1" width="1"/&gt;</description><feedburner:origLink>http://ora-00001.blogspot.com/2010/03/jqgrid-integration-kit-for-plsql-and.html</feedburner:origLink></item></channel></rss>
