<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Eddie Awad’s Blog - Latest Comments in Oracle SQL and PL/SQL Bad Practices Document</title><link>http://awads.disqus.com/</link><description>News, views, tips and tricks on Oracle and other fun stuff</description><atom:link href="https://awads.disqus.com/oracle_sql_and_plsql_bad_practices_document/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 11 Mar 2008 01:08:11 -0000</lastBuildDate><item><title>Re: Oracle SQL and PL/SQL Bad Practices Document</title><link>http://awads.net/wp/2008/03/09/oracle-sql-and-plsql-bad-practices-document/#comment-3659513</link><description>&lt;p&gt;@Noons: You're right, some of them are about database and application design, which I think is indirectly related to SQL and PL/SQL as this is how you access and manipulate the application data.&lt;/p&gt;&lt;p&gt;@John: yes, it makes sense to use a tool to generate packages for API access to table data. I believe Quest CodeGen Utility &lt;a href="http://qcgu.net/" rel="nofollow noopener" target="_blank" title="http://qcgu.net/"&gt;http://qcgu.net/&lt;/a&gt; can do that for you.&lt;/p&gt;&lt;p&gt;@gary: I agree with you. One approach is to wrap all SQL, complex or not, into separate functions.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eddie Awad</dc:creator><pubDate>Tue, 11 Mar 2008 01:08:11 -0000</pubDate></item><item><title>Re: Oracle SQL and PL/SQL Bad Practices Document</title><link>http://awads.net/wp/2008/03/09/oracle-sql-and-plsql-bad-practices-document/#comment-3659512</link><description>&lt;p&gt;The 'embedding complex SQL into PL/SQL' argument is flawed. If you have to change the view, it will still invalidate the dependent objects (ie the package) which will then be recompiled when next invoked.&lt;br&gt;You've also got two objects to deal with. Not necessarily a bad thing if the view can be re-used. But you are likely to be faced with the choice of putting filter conditions within the view itself, or as part of the query against the view.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gary</dc:creator><pubDate>Mon, 10 Mar 2008 17:54:46 -0000</pubDate></item><item><title>Re: Oracle SQL and PL/SQL Bad Practices Document</title><link>http://awads.net/wp/2008/03/09/oracle-sql-and-plsql-bad-practices-document/#comment-3659511</link><description>&lt;p&gt;I've done both PL/SQL APIs to do DML and views with instead of triggers.  The PL/SQL APIs are mostly generated by Oracle Designer and used for Designer Web PL/SQL application generation.  We wrote our own APIs for a few applications and had a major problem with the ones we wrote because they use a parameter for every column in the associated table.  This quickly becomes a maintenance nightmare - adding a new column means that you have to change EVERY module that calls the API.  If you are going to write an API, Designer's format is better - two parameters that are PL/SQL records, the first a data record, the second a record with a boolean for each column telling whether to use this value in the DML.&lt;/p&gt;&lt;p&gt;But what I really prefer is views with Instead of triggers.  You get all of the benefit of using an API, but you can use any tool that expects to be updating a table.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Flack</dc:creator><pubDate>Mon, 10 Mar 2008 09:38:14 -0000</pubDate></item><item><title>Re: Oracle SQL and PL/SQL Bad Practices Document</title><link>http://awads.net/wp/2008/03/09/oracle-sql-and-plsql-bad-practices-document/#comment-3659510</link><description>&lt;p&gt;The problem with most "bad practices" documents is that almost without exception they exceed the boundaries of their own definitions.&lt;/p&gt;&lt;p&gt;Witness the title, which apparently refers to only SQL and PL/SQL and then the following claims which have *nothing* to do with SQL or PL/SQL and are all about database and application *design*:&lt;/p&gt;&lt;p&gt;Storing ROWIDs for later reference,&lt;br&gt;Storing an empty LOB instead of NULL,&lt;br&gt;Use of magic numbers and strings instead of NULL.&lt;/p&gt;&lt;p&gt;Talk about confusing the confused...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Noons</dc:creator><pubDate>Mon, 10 Mar 2008 03:56:46 -0000</pubDate></item></channel></rss>