<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Best Practices PL/SQL with Steven Feuerstein: Most Recent Content</title>
    <description>Steven answers your questions about PL/SQL programming and best practices from a practical implementation point of view.</description>
    <link>http://www.oracle.com/technology/pub/columns/plsql/index.html</link>
    <language>en-us</language>
    <copyright>Copyright 2008, Oracle Corporation</copyright>
    <image>
      <title>Best Practices PL/SQL with Steven Feuerstein</title>
      <url>http://www.oracle.com/technology/pub/columns/images/feuerstein.jpg</url>
      <link>http://www.oracle.com/technology/pub/columns/plsql/index.html</link>
      <description>Steven answers your questions about PL/SQL programming and best practices from a practical implementation point of view.</description>
    </image>
    <item>
      <title>Knowing your LIMIT (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14922</link>
      <description>I have started using BULK COLLECT whenever I need to fetch large volumes of data. This has caused me some trouble with my DBA, however. He is complaining that although my programs might be running much faster, they are also consuming way too much memory. He refuses to approve them for a production rollout. What&apos;s a programmer to do?</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14922</guid>
      <pubDate>Tue, 13 May 2008 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Kicking the %NOTFOUND Habit (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14942</link>
      <description>I was very happy to learn that Oracle Database 10&lt;I&gt;g&lt;/I&gt; will automatically optimize my cursor FOR loops to perform at speeds comparable to BULK COLLECT. Unfortunately, my company is still running on Oracle9&lt;I&gt;i&lt;/I&gt; Database, so I have started converting my cursor FOR loops to BULK COLLECTs. I have run into a problem: I am using a LIMIT of 100, and my query retrieves a total of 227 rows, but my program processes only 200 of them. [The query is shown in Listing 2.] What am I doing wrong?</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14942</guid>
      <pubDate>Tue, 13 May 2008 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Knowing your PGA impact (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14962</link>
      <description>My DBA wants me to reduce the amount of PGA (program global area) memory I use in my 
collection-based programs. Isn&apos;t it the DBA&apos;s job to manage memory, and if it isn&apos;t, how am I supposed to know how much PGA memory I am using?</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14962</guid>
      <pubDate>Tue, 13 May 2008 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Indexing Collections (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14982</link>
      <description>I want to use associative arrays to quickly look up an office product name for a given product number and a product number for a given product name. Product names are unique, and product numbers are integers. I see how I can use the product number as the index value in my collection of names, but I also need to reverse the process and find a product number for a given product name. Can I create another index on a collection&apos;s contents? </description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:14982</guid>
      <pubDate>Tue, 13 May 2008 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Best practices—and preparation—for PL/SQL in Oracle Database 11g  (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:13582</link>
      <description>I have been reading that Oracle is launching the 11th release of its database. Very exciting! But here&apos;s the problem: I don&apos;t think I&apos;ll be able to use it for another two years. So why should I even care about the new PL/SQL features of this future (for me) release? </description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:13582</guid>
      <pubDate>Fri, 19 Oct 2007 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Best practices for PL/SQL in Oracle Database 11g and multilevel, string-indexed collections (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:13602</link>
      <description>I have been assigned one of those big blobs of spaghetti code to maintain, and in particular I have to make changes to a very complicated loop. I want to be able to make a &quot;surgical strike&quot;—put the new rules in place and then bypass the rest of the logic in the loop body with the minimum-possible fuss. What&apos;s the best way to do this?</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:13602</guid>
      <pubDate>Fri, 19 Oct 2007 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>How Do I Track My Songs?  (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:13622</link>
      <description>I work for a radio station (call it WORA—not the real name), and I need to write a program that keeps track of how many times a song is requested and played within a given period and also track the count of songs in one of our two categories: &lt;I&gt;folk&lt;/I&gt; and &lt;I&gt;rock&lt;/I&gt; (I am simplifying things for the question). Although the list of available songs is stored in a database table, this tracking information is not stored in the database; it is active only during the current session. I see how I could write the program by creating a few database tables and writing a bunch of SQL, but I wonder if there might not be an easier way.</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:13622</guid>
      <pubDate>Fri, 19 Oct 2007 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Using subtypes to work with string-indexed collections more easily (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:12942</link>
      <description>&lt;p&gt;I have started working with multi-level and string-indexed
collections. I very much like the way these features can simply the
code I need to write to manipulate complex structures. But sometimes I
get really confused trying to remember which data is used in which
index. For example, in one program, I needed to query and keep track of
some key employee information by department, using the names instead of
numbers for indexes (in our company, last names of employees are
unique!). So I wrote the code below, but got really confused when it
was time to assign the record to the right place in my complex
collection. (see &quot;?????&quot;). I finally figured it out, but I wonder if
there is something I could change in my code to avoid the confusion.
&amp;mdash;Alejandra&lt;/p&gt;
&lt;pre&gt;DECLARE&lt;br&gt;   TYPE key_info_rt IS RECORD (&lt;br&gt;      hire_date   employees.hire_date%TYPE&lt;br&gt;    , salary      employees.salary%TYPE );&lt;br&gt;&lt;br&gt;   l_emp_rec    key_info_rt;&lt;br&gt;&lt;br&gt;   TYPE employees_t IS TABLE OF key_info_rt&lt;br&gt;      INDEX BY VARCHAR2 (100);&lt;br&gt;&lt;br&gt;   TYPE emps_in_department_t IS TABLE OF employees_t&lt;br&gt;      INDEX BY VARCHAR2 (100);&lt;br&gt;&lt;br&gt;   l_emp_info   emps_in_department_t;&lt;br&gt;BEGIN&lt;br&gt;   FOR temp_rec IN (SELECT d.department_name, e.last_name, e.hire_date&lt;br&gt;                         , e.salary&lt;br&gt;                      FROM departments d, employees e&lt;br&gt;                     WHERE d.department_id = e.department_id)&lt;br&gt;   LOOP&lt;br&gt;      l_emp_rec.hire_date := temp_rec.hire_date;&lt;br&gt;      l_emp_rec.salary := temp_rec.salary;&lt;br&gt;      /*&lt;br&gt;      Now I need to put the record into the right location in my &lt;br&gt;      two-level collection. But which name do I put where?&lt;br&gt;      */&lt;br&gt;      ?????&lt;br&gt;   END LOOP;&lt;br&gt;END;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;

</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:12942</guid>
      <pubDate>Thu, 23 Aug 2007 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Never explicitly reference Oracle system error codes (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:12943</link>
      <description>&lt;p&gt;I was recently given responsibility to make a change to a
program built several years ago by a consultant. She used FORALL to
perform a massive set of inserts, and included the SAVE EXCEPTIONS
clause so we could as many of the inserts completed as possible. That
all made sense to me. But then I looked at the exception section and
got really confused. It contained this code:&lt;/p&gt;
&lt;pre&gt;EXCEPTION&lt;br&gt;   WHEN OTHERS&lt;br&gt;   THEN&lt;br&gt;      IF SQLCODE - 24381&lt;br&gt;      THEN&lt;br&gt;         ...&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;I was able to figure out what was going on&amp;mdash;after a
while. But I&apos;d really like to change it so that the next person working
on this code doesn&apos;t have to do the same detective work. What should I
do with this code?&amp;mdash;Josef&lt;/p&gt;
</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:12943</guid>
      <pubDate>Thu, 23 Aug 2007 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Generate a &quot;backup trigger&quot; for tables (Q&amp;A)</title>
      <link>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:12944</link>
      <description>&lt;p&gt;I need to implement a &quot;backup trigger&quot; on all of the tables in
my application, so that whenever anyone changes the data in one of the
tables, the existing data is copied to the backup table. I really,
really don&apos;t want to have to write these myself for 100 tables. What is
the best (you know what I mean: easiest) way to do that?.
&amp;mdash;Andy&lt;/p&gt;
</description>
      <author>PL/SQL Best Practices</author>
      <guid>http://htmldb.oracle.com/pls/otn/f?p=2853:4:::NO::P4_QA_ID:12944</guid>
      <pubDate>Thu, 23 Aug 2007 00:00:00 GMT</pubDate>
    </item>
  </channel>
</rss>
