FROM OUR READERS
From Our Readers
Your corrections, your opinions, and your requests: Here's your forum for telling us what's right and wrong in each issue of Oracle Magazine, and for letting us know what you want to read.
Giving Proper Credit
In the May/June 2004 issue of Oracle Magazine, I saw my tip "Condition-based column in query" published under Sample Code, but, in place of
my name, it was credited to Kishore Surve. Surve's script was published in the March/April 2004 issue.
Can you correct it in the next issue?
Naresh Awasthi
naresha@kyocera-wireless.com
We apologize for the error.
Decoding the Sample
I read the Sample Code "Condition-based column in query" in the May/June 2004 issue of Oracle Magazine. Although the code works, the basic premise of the example is incorrect. Contrary to the explanation, you could use DECODE to achieve certain conditions in a SQL query. This simple query uses DECODE to give the same result
as the example given in the magazine:
select parameter, decode(greatest(999,
parameter),999,'C','P') "BAND"
from parameter_table
/
In addition, the header for the second column in the magazine would read BAND, not RETURN_BAND, as shown in the example.
Robert Feld
robfeld@optonline.net
This was the first of many e-mails we received about using DECODE to perform the query described in this sample code. Thanks to all readers who pointed out this error.
Another Decode and A New Case
In reference to the Sample Code titled "Condition-based column in query" in the May/June 2004 issue of Oracle Magazine, the author mentions that there is no direct way to perform this operation in SQL. However, the same query can simply be written using a combination
of SIGN and DECODE functions (for Oracle8i and earlier) and using the
CASE construct for Oracle9i and later.
For Oracle8i and earlier:
select parameter, decode(sign
(parameter - 1000),-1,'C','P')
from parameter_table
/
For Oracle9i and later:
select parameter, case
when parameter < 1000
then
'C'
else
'P'
end
from parameter_table
/
Kailash Subbaraman
kailash1711@yahoo.com
Thanks to Subbaraman and all the other readers who e-mailed this DECODE variation and the CASE solution.
Make Useful Code
Oracle Magazine is excellent, but it
lacks content about the old versions of Oracle Developer products. I'm an Oracle Forms 6i application developer, and most of the code in the magazine isn't useful to me.
Ahmed Beleity
beleity2002@hotmail.com
|
Send Mail to the Editor
Send your opinions about what you read in Oracle Magazine, and suggestions for possible technical articles, to opubedit_us@oracle.com.
Or click on the Write the Editors link on our Web site.
Letters may be edited for length and clarity and
may be published in any medium. We consider any communications we receive publishable.
|
Looking for Listings
I have been reading the article at oracle.com/oramag/oracle/01-sep/o51xml.html ("Making Smart PL/SQL Scanning of XML Documents" from the September/October 2001 issue of Oracle Magazine), and several of the code listings appear empty. Please let me know where I can find these listings.
Martin Rendle
martin.rendle@bt.com
These listings have been restored at oracle.com/oramag/oracle/01-sep/o51xml.html. Thanks for pointing
out this issue. Any reader who finds missing or unprintable content in
issues of Oracle Magazine online is encouraged to contact us at opubedit_us@oracle.com.
Data Correction
Regarding the article "Supercharging the Pump" in the March/April
2004 issue of Oracle Magazine, the
DBA_DATAPUMP_SESSIONS view does not list the active worker processes as stated. Instead, it shows all the
clients that are monitoring Oracle
Data Pump jobs.Editor
|