Response...
John, July 01, 2004 - 1:49 pm UTC
Tom,
The article you referenced/wrote was a great help and pretty much explained everything.
The only question I have about it is that you stated that you would only use a static SQL statement opened in an IF/THEN/ELSIF block if you have just a few columns. If you were conserned about performance and had 10 columns to sort by would you still use the IF/THEN/ELSIF statements or would you just use the dynamic SQL or DECODE method. Does the benefit you gain by using static SQL drop as you have more IF/THEN/ELSIF statements or does it just simply make life easier on you to by not having to type out 10 SQL statements and 10 IF/THEN/ELSIF clauses.
Thanks again for all of your help,
John
July 01, 2004 - 7:45 pm UTC
10 is getting to be more than a few. I would probably use a dynamically opened ref cursor at that point (well, i do).
the benefit of static sql is the dependency mechanism -- using dynamic sql defeats it. It is one of the powers of plsql -- that you know what procedures use what objects.